Socket
Socket
Sign inDemoInstall

registry-auth-token

Package Overview
Dependencies
7
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.1 to 5.0.2

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # Change Log

## [5.0.2] - 2023-03-05
### Changes
- Prevent crashing on invalid npmrc files (Espen Hovlandsdal)
## [5.0.0] - 2022-06-16

@@ -7,0 +13,0 @@

12

index.js

@@ -21,6 +21,10 @@ const url = require('url')

options = options || {}
options.npmrc = options.npmrc ? {
...options.npmrc,
get: (key) => options.npmrc[key]
} : npmConf()
const providedNpmrc = options.npmrc
options.npmrc = (options.npmrc ? {
config: {
get: (key) => providedNpmrc[key]
}
} : npmConf()).config
checkUrl = checkUrl || options.npmrc.get('registry') || npmConf.defaults.registry

@@ -27,0 +31,0 @@ return getRegistryAuthInfo(checkUrl, options) || getLegacyAuthInfo(options.npmrc)

{
"name": "registry-auth-token",
"version": "5.0.1",
"version": "5.0.2",
"description": "Get the auth token set for an npm registry (if any)",

@@ -35,3 +35,3 @@ "main": "index.js",

"dependencies": {
"@pnpm/npm-conf": "^1.0.4"
"@pnpm/npm-conf": "^2.1.0"
},

@@ -38,0 +38,0 @@ "devDependencies": {

const npmConf = require('@pnpm/npm-conf')
module.exports = function getRegistryUrl (scope, npmrc) {
var rc = npmrc ? { get: (key) => npmrc[key] } : npmConf()
var url = rc.get(scope + ':registry') || rc.get('registry') || npmConf.defaults.registry
const rc = npmrc ? { config: { get: (key) => npmrc[key] } } : npmConf()
const url = rc.config.get(scope + ':registry') || rc.config.get('registry') || npmConf.defaults.registry
return url.slice(-1) === '/' ? url : url + '/'
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc