registry-url
Advanced tools
Comparing version 3.0.3 to 3.1.0
'use strict'; | ||
module.exports = function (scope) { | ||
var rc = require('rc')('npm', {registry: 'https://registry.npmjs.org/'}); | ||
return rc[scope + ':registry'] || (rc.registry.slice(-1) !== '/' ? rc.registry + '/' : rc.registry); | ||
var url = rc[scope + ':registry'] || rc.registry; | ||
return url.slice(-1) === '/' ? url : url + '/'; | ||
}; |
{ | ||
"name": "registry-url", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "Get the set npm registry URL", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "xo && ava --serial" | ||
}, | ||
@@ -36,5 +36,7 @@ "files": [ | ||
"devDependencies": { | ||
"mocha": "*", | ||
"require-uncached": "^1.0.2" | ||
"ava": "*", | ||
"pify": "^2.3.0", | ||
"require-uncached": "^1.0.2", | ||
"xo": "*" | ||
} | ||
} |
@@ -25,6 +25,6 @@ # registry-url [![Build Status](https://travis-ci.org/sindresorhus/registry-url.svg?branch=master)](https://travis-ci.org/sindresorhus/registry-url) | ||
```js | ||
var registryUrl = require('registry-url'); | ||
const registryUrl = require('registry-url'); | ||
console.log(registryUrl()); | ||
//=> https://custom-registry.com/ | ||
//=> 'https://custom-registry.com/' | ||
``` | ||
@@ -40,6 +40,6 @@ | ||
```js | ||
var registryUrl = require('registry-url'); | ||
const registryUrl = require('registry-url'); | ||
console.log(registryUrl('@myco')); | ||
//=> https://custom-registry.com/ | ||
//=> 'https://custom-registry.com/' | ||
``` | ||
@@ -46,0 +46,0 @@ |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3250
6
4