MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / stripCoreGlobalsImports

Function stripCoreGlobalsImports

packages/vite/hmr/server/websocket.ts:501–504  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

499}
500
501function stripCoreGlobalsImports(code: string): string {
502 const pattern = /^\s*(?:import\s+(?:[^'"\n]*from\s+)?|export\s+\*\s+from\s+)["'][^"']*(?:@nativescript(?:[/_-])core(?:[\/_-])globals|@nativescript_core_globals)[^"']*["'];?\s*$/gm;
503 return code.replace(pattern, '');
504}
505
506function ensureVariableDynamicImportHelper(code: string): string {
507 if (!code.includes('__variableDynamicImportRuntimeHelper')) {

Callers 1

cleanCodeFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected