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

Function coreUrl

packages/vite/hmr/server/websocket.ts:1792–1795  ·  view source on GitHub ↗
(sub?: string)

Source from the content-addressed store, hash-verified

1790 let coreAliasIdx = 0;
1791 const mkAlias = () => `__NSC${coreAliasIdx++}`;
1792 const coreUrl = (sub?: string) => {
1793 const p = (sub || '').replace(/^\//, '');
1794 return `${httpOriginSafe || ''}/ns/core` + (p ? `?p=${p}` : '');
1795 };
1796 // Case 1: import { A, B } from '@nativescript/core[/sub]'
1797 result = result.replace(/(^|\n)\s*import\s*\{\s*([^}]+?)\s*\}\s*from\s+["']@nativescript\/core([^"'\n]*)["'];?/g, (_m, pfx: string, names: string, sub: string) => {
1798 const alias = mkAlias();

Callers 1

rewriteImportsFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected