MCPcopy Create free account
hub / github.com/Wscats/vscode-explore / format

Function format

contributes/src/vs/base/common/strings.ts:38–48  ·  view source on GitHub ↗
(value: string, ...args: any[])

Source from the content-addressed store, hash-verified

36 * @param args replacements for {n}-entries
37 */
38export function format(value: string, ...args: any[]): string {
39 if (args.length === 0) {
40 return value;
41 }
42 return value.replace(_formatRegexp, function (match, group) {
43 const idx = parseInt(group, 10);
44 return isNaN(idx) || idx < 0 || idx >= args.length ?
45 match :
46 args[idx];
47 });
48}
49
50/**
51 * Converts HTML characters inside the string to use entities instead. Makes the string safe from

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected