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

Function _resolveWithContext

src/helpers/helpers.config.ts:233–253  ·  view source on GitHub ↗
(
  target: ContextCache,
  prop: string,
  receiver: AnyObject
)

Source from the content-addressed store, hash-verified

231}
232
233function _resolveWithContext(
234 target: ContextCache,
235 prop: string,
236 receiver: AnyObject
237) {
238 const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;
239 let value = _proxy[prop]; // resolve from proxy
240
241 // resolve with context
242 if (isFunction(value) && descriptors.isScriptable(prop)) {
243 value = _resolveScriptable(prop, value, target, receiver);
244 }
245 if (isArray(value) && value.length) {
246 value = _resolveArray(prop, value, target, descriptors.isIndexable);
247 }
248 if (needsSubResolver(prop, value)) {
249 // if the resolved value is an object, create a sub resolver for it
250 value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);
251 }
252 return value;
253}
254
255function _resolveScriptable(
256 prop: string,

Callers 1

getFunction · 0.85

Calls 7

isFunctionFunction · 0.85
_resolveScriptableFunction · 0.85
isArrayFunction · 0.85
_resolveArrayFunction · 0.85
needsSubResolverFunction · 0.85
_attachContextFunction · 0.85
isScriptableMethod · 0.80

Tested by

no test coverage detected