MCPcopy Index your code
hub / github.com/plotly/plotly.js / validate

Function validate

src/lib/coerce.js:603–620  ·  view source on GitHub ↗
(value, opts)

Source from the content-addressed store, hash-verified

601};
602
603function validate(value, opts) {
604 var valObjectDef = exports.valObjectMeta[opts.valType];
605
606 if(opts.arrayOk && isArrayOrTypedArray(value)) return true;
607
608 if(valObjectDef.validateFunction) {
609 return valObjectDef.validateFunction(value, opts);
610 }
611
612 var failed = {};
613 var out = failed;
614 var propMock = { set: function(v) { out = v; } };
615
616 // 'failed' just something mutable that won't be === anything else
617
618 valObjectDef.coerceFunction(value, propMock, failed, opts);
619 return out !== failed;
620}
621exports.validate = validate;

Callers 1

coerce.jsFile · 0.70

Calls 1

isArrayOrTypedArrayFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…