MCPcopy Index your code
hub / github.com/adobe/react-spectrum / getPackageName

Function getPackageName

scripts/reportExports.js:200–206  ·  view source on GitHub ↗
(specifier)

Source from the content-addressed store, hash-verified

198}
199
200function getPackageName(specifier) {
201 if (specifier.startsWith('@')) {
202 return specifier.split('/').slice(0, 2).join('/');
203 }
204
205 return specifier.split('/')[0];
206}
207
208function isRootSpecifier(specifier) {
209 return specifier === getPackageName(specifier);

Callers 2

mainFunction · 0.85
isRootSpecifierFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected