UNPKG

unpkg

Version:

The JavaScript API for unpkg

13 lines (9 loc) 277 B
const bareModuleIdentifierFormat = /^((?:@[^\/]+\/)?[^\/]+)(\/.*)?$/ function parseBareModuleIdentifier(id) { const match = bareModuleIdentifierFormat.exec(id) return { packageName: match[1], file: match[2] || "" } } module.exports = parseBareModuleIdentifier