MCPcopy Index your code
hub / github.com/nodejs/node / type

Function type

lib/internal/webidl.js:140–165  ·  view source on GitHub ↗

* Returns the ECMAScript specification type of a JavaScript value. * @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values * @param {any} V JavaScript value. * @returns {'Undefined'|'Null'|'Boolean'|'String'|'Symbol'|'Number'|'BigInt'|'Object'}

(V)

Source from the content-addressed store, hash-verified

138 * @returns {'Undefined'|'Null'|'Boolean'|'String'|'Symbol'|'Number'|'BigInt'|'Object'}
139 */
140function type(V) {
141 // ECMA-262 6.1: map JavaScript values to language type names.
142 switch (typeof V) {
143 case 'undefined':
144 return 'Undefined';
145 case 'boolean':
146 return 'Boolean';
147 case 'string':
148 return 'String';
149 case 'symbol':
150 return 'Symbol';
151 case 'number':
152 return 'Number';
153 case 'bigint':
154 return 'BigInt';
155 case 'object':
156 case 'function':
157 default:
158 // ECMA-262 6.1.2: null is its own language type.
159 // ECMA-262 6.1.7: functions are Object values.
160 if (V === null) {
161 return 'Null';
162 }
163 return 'Object';
164 }
165}
166
167/**
168 * Returns IntegerPart(n).

Callers 4

webidl.jsFile · 0.70
createSequenceConverterFunction · 0.70
webidl.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…