MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / accessor

Function accessor

packages/vite/hmr/vendor-bootstrap.ts:15–26  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

13 const getRegistry = () => (globalThis as any).__nsModules || (globalThis as any).__nsModuleRegistry || null;
14
15 const accessor: VendorLookupFn = function (id: string): any {
16 if (!id) return undefined;
17 const manifest = getManifest();
18 const registry = getRegistry();
19 if (!manifest || !manifest.modules || !registry) return undefined;
20 // Direct match
21 if (registry.get && registry.get(id)) return registry.get(id);
22 // Try alias resolution
23 const alias = manifest.aliases?.[id];
24 if (alias && registry.get && registry.get(alias)) return registry.get(alias);
25 return undefined;
26 };
27
28 Object.defineProperty(globalThis, '__nsVendor', {
29 value: accessor,

Callers

nothing calls this directly

Calls 3

getManifestFunction · 0.85
getRegistryFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected