MCPcopy Create free account
hub / github.com/sveltejs/devalue / stringify_primitive

Function stringify_primitive

src/stringify.js:394–401  ·  view source on GitHub ↗

* @param {any} thing * @returns {string}

(thing)

Source from the content-addressed store, hash-verified

392 * @returns {string}
393 */
394function stringify_primitive(thing) {
395 const type = typeof thing;
396 if (type === 'string') return stringify_string(thing);
397 if (thing === void 0) return UNDEFINED.toString();
398 if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();
399 if (type === 'bigint') return `["BigInt","${thing}"]`;
400 return String(thing);
401}

Callers 1

flattenFunction · 0.70

Calls 1

stringify_stringFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…