MCPcopy
hub / github.com/formatjs/formatjs / bareSpecifier

Function bareSpecifier

tools/check_package_json.ts:14–24  ·  view source on GitHub ↗
(spec: string)

Source from the content-addressed store, hash-verified

12const NODE_BUILTINS = new Set(builtinModules)
13
14function bareSpecifier(spec: string): string | undefined {
15 if (spec.startsWith('.') || spec.startsWith('/')) return
16 if (spec.startsWith('node:')) return
17 if (NODE_BUILTINS.has(spec)) return
18 const parts = spec.split('/')
19 if (spec.startsWith('@')) {
20 if (parts.length < 2) return
21 return parts.slice(0, 2).join('/')
22 }
23 return parts[0]
24}
25
26function checkBundle(
27 bundlePath: string,

Callers 1

checkBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected