MCPcopy
hub / github.com/aframevr/aframe / stringifyProperty

Function stringifyProperty

src/core/schema.js:197–206  ·  view source on GitHub ↗
(value, propDefinition)

Source from the content-addressed store, hash-verified

195 * Serialize a single property.
196 */
197export function stringifyProperty (value, propDefinition) {
198 // This function stringifies but it's used in a context where
199 // there's always second stringification pass. By returning the original
200 // value when it's not an object we save one unnecessary call
201 // to JSON.stringify.
202 if (typeof value !== 'object') { return value; }
203 // if there's no schema for the property we use standard JSON stringify
204 if (!propDefinition || value === null) { return JSON.stringify(value); }
205 return propDefinition.stringify(value);
206}

Callers 3

schema.test.jsFile · 0.90
component.jsFile · 0.85
stringifyPropertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected