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

Function toQp

packages/vite/hmr/server/core-sanitize.ts:112–118  ·  view source on GitHub ↗
(sub: string)

Source from the content-addressed store, hash-verified

110 try {
111 let out = code;
112 const toQp = (sub: string) => {
113 const s = String(sub || '')
114 .split('?')[0]
115 .trim()
116 .replace(/^\//, '');
117 return s ? `?p=${s}` : '';
118 };
119 // Static: import ... from "...@nativescript/core[/sub]..."
120 out = out.replace(/from\s+["'][^"']*@nativescript[\/_-]core([^"']*)["']/g, (_m, sub: string) => `from "/ns/core${toQp(sub)}"`);
121 // Side-effect: import "...@nativescript/core[/sub]..."

Callers 1

Calls 2

replaceMethod · 0.80
StringClass · 0.50

Tested by

no test coverage detected