MCPcopy Create free account
hub / github.com/chartjs/Chart.js / getResolver

Function getResolver

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

Source from the content-addressed store, hash-verified

498}
499
500function getResolver(resolverCache, scopes, prefixes) {
501 let cache = resolverCache.get(scopes);
502 if (!cache) {
503 cache = new Map();
504 resolverCache.set(scopes, cache);
505 }
506 const cacheKey = prefixes.join();
507 let cached = cache.get(cacheKey);
508 if (!cached) {
509 const resolver = _createResolver(scopes, prefixes);
510 cached = {
511 resolver,
512 subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))
513 };
514 cache.set(cacheKey, cached);
515 }
516 return cached;
517}
518
519const hasFunction = value => isObject(value)
520 && 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