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

Function toDestructureCore

packages/vite/hmr/server/websocket.ts:1403–1412  ·  view source on GitHub ↗
(specList: string)

Source from the content-addressed store, hash-verified

1401 {
1402 let __core_ns_seq = 0;
1403 const toDestructureCore = (specList: string) =>
1404 specList
1405 .split(',')
1406 .map((s) => s.trim())
1407 .filter(Boolean)
1408 .map((seg) => {
1409 const m = seg.split(/\s+as\s+/i);
1410 return m.length === 2 ? `${m[0].trim()}: ${m[1].trim()}` : seg;
1411 })
1412 .join(', ');
1413 const reNamed = /(^|\n)\s*import\s*\{([^}]+)\}\s*from\s*["']((?:https?:\/\/[^"']+)?\/ns\/core(?:\/[\d]+)?(?:\?p=[^"']+)?)['"];?\s*/gm;
1414 result = result.replace(reNamed, (_full, pfx: string, specList: string, src: string) => {
1415 __core_ns_seq++;

Callers 1

processCodeForDeviceFunction · 0.85

Calls 3

joinMethod · 0.80
mapMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected