(path: string)
| 68 | * the corresponding npm specifier such as "d3-array@3.2.4/src/index.js". |
| 69 | */ |
| 70 | export 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, |
no outgoing calls
no test coverage detected