chore: import upstream snapshot with attribution
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// TODO: this is a straight up copy of the format function from the client.
|
||||
// Figure out a way to share it.
|
||||
|
||||
import { inspect } from 'util/util.js';
|
||||
|
||||
export function format(x) {
|
||||
// we're trying to mimic console.log, so we avoid wrapping strings in quotes:
|
||||
if (typeof x === 'string') return x;
|
||||
else if (x instanceof Set) {
|
||||
return `Set(${x.size}) {${Array.from(x).join(', ')}}`;
|
||||
} else if (x instanceof Map) {
|
||||
return `Map(${x.size}) {${Array.from(
|
||||
x.entries(),
|
||||
([k, v]) => `${k} => ${v}`
|
||||
).join(', ')}})`;
|
||||
} else if (typeof x === 'bigint') {
|
||||
return x.toString() + 'n';
|
||||
} else if (typeof x === 'symbol') {
|
||||
return x.toString();
|
||||
}
|
||||
return inspect(x);
|
||||
}
|
||||
Reference in New Issue
Block a user