MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / string

Method string

Extension/src/Utility/Text/taggedLiteral.ts:195–210  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

193 }
194
195 static string(value: any): string | undefined {
196 switch (typeof value) {
197 case 'object':
198 return undefined;
199
200 case 'string':
201 return value;
202
203 case 'number':
204 case 'boolean':
205 return isFinite(value as any) ? value.toString() : undefined;
206
207 default:
208 return undefined;
209 }
210 }
211
212 static js(value: any): Primitive | undefined {
213 return JSON.stringify(as.primitive(value));

Callers 2

renderFunction · 0.45
recursiveRenderFunction · 0.45

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected