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

Function getResolver

src/core/core.config.js:383–400  ·  view source on GitHub ↗
(resolverCache, scopes, prefixes)

Source from the content-addressed store, hash-verified

381}
382
383function getResolver(resolverCache, scopes, prefixes) {
384 let cache = resolverCache.get(scopes);
385 if (!cache) {
386 cache = new Map();
387 resolverCache.set(scopes, cache);
388 }
389 const cacheKey = prefixes.join();
390 let cached = cache.get(cacheKey);
391 if (!cached) {
392 const resolver = _createResolver(scopes, prefixes);
393 cached = {
394 resolver,
395 subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))
396 };
397 cache.set(cacheKey, cached);
398 }
399 return cached;
400}
401
402const hasFunction = value => isObject(value)
403 && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key]));

Callers 2

resolveNamedOptionsMethod · 0.85
createResolverMethod · 0.85

Calls 3

_createResolverFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected