MCPcopy Index your code
hub / github.com/immutable-js/immutable-js / quoteString

Function quoteString

src/utils/quoteString.ts:4–11  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

2 * Converts a value to a string, adding quotes if a string was provided.
3 */
4export default function quoteString(value: unknown): string {
5 try {
6 return typeof value === 'string' ? JSON.stringify(value) : String(value);
7 // eslint-disable-next-line @typescript-eslint/no-unused-vars
8 } catch (_ignoreError) {
9 return JSON.stringify(value);
10 }
11}

Callers 2

toStringMethod · 0.85
CollectionImpl.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected