Sha256: ecb40bfaf1249a08ad25f856cf2eae0303179e4402a8afa9fe9e8a65f881d5c5
Contents?: true
Size: 382 Bytes
Versions: 5
Compression:
Stored size: 382 Bytes
Contents
import { basename, extname, dirname, sep } from 'path'; import { makeLegalIdentifier } from 'rollup-pluginutils'; export function getName ( id ) { const name = makeLegalIdentifier( basename( id, extname( id ) ) ); if (name !== 'index') { return name; } else { const segments = dirname( id ).split( sep ); return makeLegalIdentifier( segments[segments.length - 1] ); } }
Version data entries
5 entries across 5 versions & 2 rubygems