MCPcopy Index your code
hub / github.com/midrender/revideo / stringify

Function stringify

packages/core/src/utils/debug.ts:4–19  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

2import {useLogger} from './useScene';
3
4function stringify(value: any): string {
5 switch (typeof value) {
6 case 'string':
7 // Prevent strings from getting quoted again
8 return value;
9 case 'undefined':
10 // Prevent `undefined` from being turned into `null`
11 return 'undefined';
12 default:
13 // Prevent `NaN` from being turned into `null`
14 if (Number.isNaN(value)) {
15 return 'NaN';
16 }
17 return JSON.stringify(value);
18 }
19}
20
21/**
22 * Logs a debug message with an arbitrary payload.

Callers 1

debugFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected