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

Method primitive

Extension/src/Utility/System/guards.ts:14–22  ·  view source on GitHub ↗

Returns true if the value is a string, number, or boolean

(node: any)

Source from the content-addressed store, hash-verified

12export class is {
13 /** Returns true if the value is a string, number, or boolean */
14 static primitive(node: any): node is Primitive {
15 switch (typeof node) {
16 case 'boolean':
17 case 'number':
18 case 'string':
19 return true;
20 }
21 return false;
22 }
23
24 static object(node: any): node is Record<string, any> {
25 return typeof node === 'object' && node !== null && !is.array(node);

Callers 1

optionsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected