MCPcopy Create free account
hub / github.com/rollup/plugins / getName

Function getName

packages/commonjs/src/utils.js:25–31  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

23}
24
25export function getName(id) {
26 const name = makeLegalIdentifier(basename(id, extname(id)));
27 if (name !== 'index') {
28 return name;
29 }
30 return makeLegalIdentifier(basename(dirname(id)));
31}
32
33export function normalizePathSlashes(path) {
34 return path.replace(/\\/g, '/');

Callers 5

getUnknownRequireProxyFunction · 0.90
getStaticRequireProxyFunction · 0.90
getEsImportProxyFunction · 0.90
loadFunction · 0.90
transformCommonjsFunction · 0.90

Calls 1

makeLegalIdentifierFunction · 0.90

Tested by

no test coverage detected