Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/simulation/fixtures/edit-convert-ternary-to-if-else/index.ts
13399 views
1
function toLogString(args: any[]) {
2
return `[${args.map(arg => JSON.stringify(arg, (key, value) => {
3
const t = typeof value;
4
if (t === 'object') {
5
return !key ? value : String(value);
6
}
7
if (t === 'function') {
8
return `[Function: ${value.name}]`;
9
}
10
if (t === 'bigint') {
11
return String(value);
12
}
13
return value;
14
})).join(', ')}]`;
15
}
16