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

Function parseProperty

src/core/schema.js:159–167  ·  view source on GitHub ↗
(value, propDefinition, target)

Source from the content-addressed store, hash-verified

157 * @param {any} target - Optional target value to parse into (reuse).
158 */
159export function parseProperty (value, propDefinition, target) {
160 // Use default value if value is falsy.
161 if (value === undefined || value === null || value === '') {
162 value = propDefinition.default;
163 if (Array.isArray(value)) { value = value.slice(); }
164 }
165 // Invoke property type parser.
166 return propDefinition.parse(value, propDefinition.default, target);
167}
168
169/**
170 * Serialize a group of properties.

Callers 5

system.jsFile · 0.90
schema.test.jsFile · 0.90
component.jsFile · 0.85
registerComponentFunction · 0.85
schema.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected