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

Function setGlobal

packages/vite/hmr/shared/runtime/vendor-bootstrap.ts:5–13  ·  view source on GitHub ↗
(k: string, v: any)

Source from the content-addressed store, hash-verified

3export function installVendorBootstrap(vendorManifest: any, __nsVendorModuleMap: Record<string, any>, verbose?: boolean) {
4 const g: any = globalThis as any;
5 const setGlobal = (k: string, v: any) => {
6 try {
7 Object.defineProperty(g, k, { value: v, configurable: true, writable: true });
8 } catch {
9 try {
10 g[k] = v;
11 } catch {}
12 }
13 };
14
15 const manifest = vendorManifest ?? {};
16 let registry: Map<string, any> = g['__nsVendorRegistry'];

Callers 1

installVendorBootstrapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected