MCPcopy
hub / github.com/chartjs/Chart.js / needContext

Function needContext

src/core/core.config.js:405–418  ·  view source on GitHub ↗
(proxy, names)

Source from the content-addressed store, hash-verified

403 && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key]));
404
405function needContext(proxy, names) {
406 const {isScriptable, isIndexable} = _descriptors(proxy);
407
408 for (const prop of names) {
409 const scriptable = isScriptable(prop);
410 const indexable = isIndexable(prop);
411 const value = (indexable || scriptable) && proxy[prop];
412 if ((scriptable && (isFunction(value) || hasFunction(value)))
413 || (indexable && isArray(value))) {
414 return true;
415 }
416 }
417 return false;
418}

Callers 1

resolveNamedOptionsMethod · 0.85

Calls 4

_descriptorsFunction · 0.85
isFunctionFunction · 0.85
hasFunctionFunction · 0.85
isArrayFunction · 0.85

Tested by

no test coverage detected