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

Function _cached

src/helpers/helpers.config.ts:218–231  ·  view source on GitHub ↗
(
  target: AnyObject,
  prop: string,
  resolve: () => unknown
)

Source from the content-addressed store, hash-verified

216 (Object.getPrototypeOf(value) === null || value.constructor === Object);
217
218function _cached(
219 target: AnyObject,
220 prop: string,
221 resolve: () => unknown
222) {
223 if (Object.prototype.hasOwnProperty.call(target, prop) || prop === 'constructor') {
224 return target[prop];
225 }
226
227 const value = resolve();
228 // cache the resolved value
229 target[prop] = value;
230 return value;
231}
232
233function _resolveWithContext(
234 target: ContextCache,

Callers 1

getFunction · 0.85

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…