Socket
Socket
Sign inDemoInstall

@npmcli/config

Package Overview
Dependencies
Maintainers
6
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@npmcli/config - npm Package Compare versions

Comparing version 6.1.6 to 6.1.7

25

lib/index.js

@@ -527,17 +527,24 @@ // TODO: set the scope config from package.json or explicit cli config

const typeDesc = typeDescription(type)
const oneOrMore = typeDesc.indexOf(Array) !== -1
const mustBe = typeDesc
.filter(m => m !== undefined && m !== Array)
const oneOf = mustBe.length === 1 && oneOrMore ? ' one or more'
: mustBe.length > 1 && oneOrMore ? ' one or more of:'
: mustBe.length > 1 ? ' one of:'
: ''
const msg = 'Must be' + oneOf
const msg = 'Must be' + this.#getOneOfKeywords(mustBe, typeDesc)
const desc = mustBe.length === 1 ? mustBe[0]
: mustBe.filter(m => m !== Array)
.map(n => typeof n === 'string' ? n : JSON.stringify(n))
.join(', ')
: [...new Set(mustBe.map(n => typeof n === 'string' ? n : JSON.stringify(n)))].join(', ')
log.warn('invalid config', msg, desc)
}
#getOneOfKeywords (mustBe, typeDesc) {
let keyword
if (mustBe.length === 1 && typeDesc.includes(Array)) {
keyword = ' one or more'
} else if (mustBe.length > 1 && typeDesc.includes(Array)) {
keyword = ' one or more of:'
} else if (mustBe.length > 1) {
keyword = ' one of:'
} else {
keyword = ''
}
return keyword
}
#loadObject (obj, where, source, er = null) {

@@ -544,0 +551,0 @@ // obj is the raw data read from the file

{
"name": "@npmcli/config",
"version": "6.1.6",
"version": "6.1.7",
"files": [

@@ -36,3 +36,3 @@ "bin/",

"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.12.1",
"@npmcli/template-oss": "4.14.1",
"tap": "^16.3.4"

@@ -54,4 +54,4 @@ },

"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.12.1"
"version": "4.14.1"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc