MCPcopy Create free account
hub / github.com/observablehq/framework / extractNodeSpecifier

Function extractNodeSpecifier

src/node.ts:70–73  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

68 * the corresponding npm specifier such as "d3-array@3.2.4/src/index.js".
69 */
70export function extractNodeSpecifier(path: string): string {
71 if (!path.startsWith("/_node/")) throw new Error(`invalid node path: ${path}`);
72 return path.replace(/^\/_node\//, "");
73}
74
75/**
76 * React (and its dependencies) are distributed as CommonJS modules, and worse,

Callers 3

node-test.tsFile · 0.85
resolveResolversFunction · 0.85
getModuleStaticImportsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected