util-array-object-or-both
Advanced tools
Comparing version 3.0.6 to 3.0.7
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 3.0.6 | ||
* Version: 3.0.7 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -30,25 +30,18 @@ * License: MIT | ||
}; | ||
var opts = _objectSpread__default['default'](_objectSpread__default['default']({}, defaults), originalOpts); | ||
if (opts && opts.msg && opts.msg.length > 0) { | ||
opts.msg = opts.msg.trim() + " "; | ||
} | ||
if (opts.optsVarName !== "given variable") { | ||
opts.optsVarName = "variable \"" + opts.optsVarName + "\""; | ||
} | ||
if (includes__default['default'](onlyObjectValues, str.toLowerCase().trim())) { | ||
return "object"; | ||
} | ||
if (includes__default['default'](onlyArrayValues, str.toLowerCase().trim())) { | ||
return "array"; | ||
} | ||
if (includes__default['default'](onlyAnyValues, str.toLowerCase().trim())) { | ||
return "any"; | ||
} | ||
throw new TypeError(opts.msg + "The " + opts.optsVarName + " was customised to an unrecognised value: " + str + ". Please check it against the API documentation."); | ||
@@ -55,0 +48,0 @@ } |
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 3.0.6 | ||
* Version: 3.0.7 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -6,0 +6,0 @@ * License: MIT |
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 3.0.6 | ||
* Version: 3.0.7 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -23,23 +23,17 @@ * License: MIT | ||
}; | ||
if (opts && opts.msg && opts.msg.length > 0) { | ||
opts.msg = `${opts.msg.trim()} `; | ||
} | ||
if (opts.optsVarName !== "given variable") { | ||
opts.optsVarName = `variable "${opts.optsVarName}"`; | ||
} | ||
if (includes(onlyObjectValues, str.toLowerCase().trim())) { | ||
return "object"; | ||
} | ||
if (includes(onlyArrayValues, str.toLowerCase().trim())) { | ||
return "array"; | ||
} | ||
if (includes(onlyAnyValues, str.toLowerCase().trim())) { | ||
return "any"; | ||
} | ||
throw new TypeError(`${opts.msg}The ${opts.optsVarName} was customised to an unrecognised value: ${str}. Please check it against the API documentation.`); | ||
@@ -46,0 +40,0 @@ } |
/** | ||
* util-array-object-or-both | ||
* Validate and normalise user choice: array, object or both? | ||
* Version: 3.0.6 | ||
* Version: 3.0.7 | ||
* Author: Roy Revelt, Codsen Ltd | ||
@@ -6,0 +6,0 @@ * License: MIT |
{ | ||
"name": "util-array-object-or-both", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Validate and normalise user choice: array, object or both?", | ||
@@ -78,22 +78,22 @@ "keywords": [ | ||
"dependencies": { | ||
"@babel/runtime": "^7.12.13", | ||
"@babel/runtime": "^7.13.9", | ||
"lodash.includes": "^4.3.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.12.16", | ||
"@babel/cli": "^7.13.0", | ||
"@babel/core": "^7.12.16", | ||
"@babel/node": "^7.12.16", | ||
"@babel/node": "^7.13.0", | ||
"@babel/plugin-external-helpers": "^7.12.13", | ||
"@babel/plugin-proposal-class-properties": "^7.12.13", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.12.13", | ||
"@babel/plugin-proposal-optional-chaining": "^7.12.16", | ||
"@babel/plugin-transform-runtime": "^7.12.15", | ||
"@babel/plugin-proposal-optional-chaining": "^7.13.8", | ||
"@babel/plugin-transform-runtime": "^7.13.9", | ||
"@babel/preset-env": "^7.12.16", | ||
"@babel/preset-typescript": "^7.12.16", | ||
"@babel/register": "^7.12.13", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@babel/register": "^7.13.8", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^17.1.0", | ||
"@rollup/plugin-node-resolve": "^11.2.0", | ||
"@rollup/plugin-replace": "^2.3.4", | ||
"@rollup/plugin-replace": "^2.4.1", | ||
"@rollup/plugin-strip": "^2.0.0", | ||
@@ -103,8 +103,8 @@ "@rollup/plugin-typescript": "^8.2.0", | ||
"@types/node": "^14.14.27", | ||
"@types/tap": "^14.10.2", | ||
"@types/tap": "^14.10.3", | ||
"@typescript-eslint/eslint-plugin": "^4.15.0", | ||
"@typescript-eslint/parser": "^4.15.0", | ||
"@typescript-eslint/parser": "^4.16.1", | ||
"eslint": "^7.20.0", | ||
"lect": "^0.16.6", | ||
"rollup": "^2.39.0", | ||
"lect": "^0.16.7", | ||
"rollup": "^2.40.0", | ||
"rollup-plugin-ascii": "^0.0.3", | ||
@@ -111,0 +111,0 @@ "rollup-plugin-banner": "^0.2.1", |
Sorry, the diff of this file is not supported yet
42899
Updated@babel/runtime@^7.13.9