From 518a664500bcde30475788e8c1c3e651f23e881b Mon Sep 17 00:00:00 2001 From: isaacs Date: Tue, 8 Dec 2020 16:00:24 -0800 Subject: [PATCH] @npmcli/config@1.2.4 --- node_modules/@npmcli/config/lib/parse-field.js | 4 ++-- node_modules/@npmcli/config/lib/type-defs.js | 8 ++++++++ node_modules/@npmcli/config/package.json | 2 +- package-lock.json | 14 +++++++------- package.json | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/node_modules/@npmcli/config/lib/parse-field.js b/node_modules/@npmcli/config/lib/parse-field.js index 216295a5f81d8..95b8d9f272003 100644 --- a/node_modules/@npmcli/config/lib/parse-field.js +++ b/node_modules/@npmcli/config/lib/parse-field.js @@ -15,7 +15,7 @@ const parseField = (f, key, opts, listElement = false) => { const typeList = new Set([].concat(types[key])) const isPath = typeList.has(typeDefs.path.type) const isBool = typeList.has(typeDefs.Boolean.type) - const isString = typeList.has(typeDefs.String.type) + const isString = isPath || typeList.has(typeDefs.String.type) const isUmask = typeList.has(typeDefs.Umask.type) const isNumber = typeList.has(typeDefs.Number.type) const isList = !listElement && typeList.has(Array) @@ -38,7 +38,7 @@ const parseField = (f, key, opts, listElement = false) => { // string types can be the string 'true', 'false', etc. // otherwise, parse these values out - if (!isString) { + if (!isString && !isPath && !isNumber) { switch (f) { case 'true': return true case 'false': return false diff --git a/node_modules/@npmcli/config/lib/type-defs.js b/node_modules/@npmcli/config/lib/type-defs.js index 07703206c5743..049945a3e5812 100644 --- a/node_modules/@npmcli/config/lib/type-defs.js +++ b/node_modules/@npmcli/config/lib/type-defs.js @@ -10,6 +10,13 @@ const validateSemver = (data, k, val) => { data[k] = valid } +const noptValidatePath = nopt.typeDefs.path.validate +const validatePath = (data, k, val) => { + if (typeof val !== 'string') + return false + return noptValidatePath(data, k, val) +} + // add descriptions so we can validate more usefully module.exports = { ...nopt.typeDefs, @@ -29,6 +36,7 @@ module.exports = { }, path: { ...nopt.typeDefs.path, + validate: validatePath, description: 'valid filesystem path', }, Number: { diff --git a/node_modules/@npmcli/config/package.json b/node_modules/@npmcli/config/package.json index 579acd5b28371..eebb8d23e914d 100644 --- a/node_modules/@npmcli/config/package.json +++ b/node_modules/@npmcli/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "1.2.3", + "version": "1.2.4", "files": [ "lib" ], diff --git a/package-lock.json b/package-lock.json index 00662a98247c5..da79f7cb469a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -356,7 +356,7 @@ "dependencies": { "@npmcli/arborist": "^2.0.0", "@npmcli/ci-detect": "^1.2.0", - "@npmcli/config": "^1.2.3", + "@npmcli/config": "^1.2.4", "@npmcli/run-script": "^1.8.1", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", @@ -700,9 +700,9 @@ "license": "ISC" }, "node_modules/@npmcli/config": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-1.2.3.tgz", - "integrity": "sha512-rRggEgNdsG4QohT+PEErKKRqyfxqKQSs4Bm46uOQW16FwSMlHWrJo7NEB4oNrgRwjMU4bDFjuoDWpot6DQi8xw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-1.2.4.tgz", + "integrity": "sha512-q68HN9krNkBO93oIN4+FHEwc+hhskGtmniCfR5rY4HX8Bfet85o+eaXFy08mWpzoZDhh5WkkZm2BStcvFp3iBQ==", "inBundle": true, "dependencies": { "ini": "^1.3.5", @@ -9517,9 +9517,9 @@ "version": "1.3.0" }, "@npmcli/config": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-1.2.3.tgz", - "integrity": "sha512-rRggEgNdsG4QohT+PEErKKRqyfxqKQSs4Bm46uOQW16FwSMlHWrJo7NEB4oNrgRwjMU4bDFjuoDWpot6DQi8xw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-1.2.4.tgz", + "integrity": "sha512-q68HN9krNkBO93oIN4+FHEwc+hhskGtmniCfR5rY4HX8Bfet85o+eaXFy08mWpzoZDhh5WkkZm2BStcvFp3iBQ==", "requires": { "ini": "^1.3.5", "mkdirp-infer-owner": "^2.0.0", diff --git a/package.json b/package.json index 299c628afbbe0..ea1379c4cfb0a 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "dependencies": { "@npmcli/arborist": "^2.0.0", "@npmcli/ci-detect": "^1.2.0", - "@npmcli/config": "^1.2.3", + "@npmcli/config": "^1.2.4", "@npmcli/run-script": "^1.8.1", "abbrev": "~1.1.1", "ansicolors": "~0.3.2",