get-npm-tarball-url
Advanced tools
Comparing version 1.0.0 to 1.0.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function default_1(pkgName, pkgVersion, opts) { | ||
const registry = opts && opts.registry || 'http://registry.npmjs.org'; | ||
const registry = normalizeRegistry(opts && opts.registry || 'http://registry.npmjs.org/'); | ||
const encodedName = getEncodedName(pkgName); | ||
const scopelessName = getScopelessName(pkgName); | ||
return `${registry}/${encodedName}/-/${scopelessName}-${pkgVersion}.tgz`; | ||
return `${registry}${encodedName}/-/${scopelessName}-${pkgVersion}.tgz`; | ||
} | ||
exports.default = default_1; | ||
function normalizeRegistry(registry) { | ||
if (registry[registry.length - 1] === '/') | ||
return registry; | ||
return `${registry}/`; | ||
} | ||
function getEncodedName(name) { | ||
@@ -11,0 +16,0 @@ if (name[0] === '@') { |
{ | ||
"name": "get-npm-tarball-url", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Create the tarball URL of a npm package", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4481
29