MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / findAddonCacheEntriesByName

Function findAddonCacheEntriesByName

tests/helpers/per-bundle-addon-cache.js:169–181  ·  view source on GitHub ↗

* For help with testing, given a bundleHostName and an addon name, return * a list of the addon cache entries that have that addon name. * * @name findAddonCacheEntriesByName

(perBundleAddonCacheInstance, bundleHostPkgInfo, addonName)

Source from the content-addressed store, hash-verified

167 * @name findAddonCacheEntriesByName
168 */
169function findAddonCacheEntriesByName(perBundleAddonCacheInstance, bundleHostPkgInfo, addonName) {
170 let bundleHostCacheEntry = perBundleAddonCacheInstance.bundleHostCache.get(bundleHostPkgInfo);
171
172 if (!bundleHostCacheEntry) {
173 return null;
174 }
175
176 let addonInstanceCache = bundleHostCacheEntry.addonInstanceCache;
177 let cacheEntries = Array.from(addonInstanceCache.values());
178 let addonEntries = cacheEntries.filter((entry) => entry[TARGET_INSTANCE].name === addonName);
179
180 return addonEntries;
181}
182
183/**
184 * Simple utilities to help test the PerBundleAddonCache feature.

Callers 1

proxy-test.jsFile · 0.85

Calls 2

getMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…