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

Function stringifyPrimitive

lib/querystring.js:178–188  ·  view source on GitHub ↗

* @param {string | number | bigint | boolean | symbol | undefined | null} v * @returns {string}

(v)

Source from the content-addressed store, hash-verified

176 * @returns {string}
177 */
178function stringifyPrimitive(v) {
179 if (typeof v === 'string')
180 return v;
181 if (typeof v === 'number' && NumberIsFinite(v))
182 return '' + v;
183 if (typeof v === 'bigint')
184 return '' + v;
185 if (typeof v === 'boolean')
186 return v ? 'true' : 'false';
187 return '';
188}
189
190/**
191 * @param {string | number | bigint | boolean} v

Callers 1

encodeStringifiedCustomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…