util-array-object-or-both
Advanced tools
Comparing version 2.0.3 to 2.1.0
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
@@ -7,22 +8,40 @@ | ||
## [2.1.0] - 2018-05-25 | ||
### Improvements | ||
* ✨ Set up [Prettier](https://prettier.io) on a custom ESLint rule set. | ||
* ✨ Removed `package.lock` and `.editorconfig` | ||
* ✨ Wired Rollup to remove comments from non-dev builds. This means we can now leave the `console.log`s in the source code — there's no need to comment-out `console.log` statements or care about them not spilling into production. Now it's done automatically. | ||
* ✨ Unit tests are pointing at ES modules build, which means that code coverage is correct now, without Babel functions being missed. This is important because now code coverage is real again and now there are no excuses not to perfect it. | ||
## [2.0.0] - 2017-12-13 | ||
### Changed | ||
- ✨ Rebased in ES Modules | ||
- ✨ Set up Rollup. Now we serve three builds: CommonJS, UMD and ES Module. | ||
* ✨ Rebased in ES Modules | ||
* ✨ Set up Rollup. Now we serve three builds: CommonJS, UMD and ES Module. | ||
## [1.2.0] - 2017-09-20 | ||
### Changed | ||
- Dropped JS Standard and switched to raw ESLint on `airbnb-base` preset. Of course, with overrides to ban semicolons and allow plus-plus in loops. | ||
* Dropped JS Standard and switched to raw ESLint on `airbnb-base` preset. Of course, with overrides to ban semicolons and allow plus-plus in loops. | ||
## [1.1.0] - 2017-08-09 | ||
### Removed | ||
- Replaced `object-assign` with native ES6 `Object.assign` | ||
- We don't need `lodash.clonedeep` either, we can just Object.assign onto a empty object literal because Object.assign sources are not mutated. | ||
* Replaced `object-assign` with native ES6 `Object.assign` | ||
* We don't need `lodash.clonedeep` either, we can just Object.assign onto a empty object literal because Object.assign sources are not mutated. | ||
## 1.0.0 - 2017-06-13 | ||
### New | ||
- Public release | ||
* Public release | ||
[2.1.0]: https://github.com/codsen/util-array-object-or-both/compare/v2.0.0...v2.1.0 | ||
[2.0.0]: https://github.com/codsen/util-array-object-or-both/compare/v1.2.0...v2.0.0 | ||
[1.2.0]: https://github.com/codsen/util-array-object-or-both/compare/v1.1.0...v1.2.0 | ||
[1.1.0]: https://github.com/codsen/util-array-object-or-both/compare/v1.0.0...v1.1.0 |
@@ -16,45 +16,45 @@ 'use strict'; | ||
if (!existy(str)) { | ||
throw new Error('util-array-object-or-both/validate(): [THROW_ID_01] Please provide a string to work on. Currently it\'s equal to ' + JSON.stringify(str, null, 4)); | ||
throw new Error("util-array-object-or-both/validate(): [THROW_ID_01] Please provide a string to work on. Currently it's equal to " + JSON.stringify(str, null, 4)); | ||
} | ||
if (typeof str !== 'string') { | ||
throw new Error('util-array-object-or-both/validate(): [THROW_ID_02] Input must be string! Currently it\'s ' + (typeof str === 'undefined' ? 'undefined' : _typeof(str)) + ', equal to: ' + JSON.stringify(str, null, 4)); | ||
if (typeof str !== "string") { | ||
throw new Error("util-array-object-or-both/validate(): [THROW_ID_02] Input must be string! Currently it's " + (typeof str === "undefined" ? "undefined" : _typeof(str)) + ", equal to: " + JSON.stringify(str, null, 4)); | ||
} | ||
if (existy(originalOpts) && !isObj(originalOpts)) { | ||
throw new Error('util-array-object-or-both/validate(): [THROW_ID_03] Second argument, options object, must be, well, object! Currenlty it\'s: ' + (typeof originalOpts === 'undefined' ? 'undefined' : _typeof(originalOpts)) + ', equal to: ' + JSON.stringify(originalOpts, null, 4)); | ||
throw new Error("util-array-object-or-both/validate(): [THROW_ID_03] Second argument, options object, must be, well, object! Currenlty it's: " + (typeof originalOpts === "undefined" ? "undefined" : _typeof(originalOpts)) + ", equal to: " + JSON.stringify(originalOpts, null, 4)); | ||
} | ||
var onlyObjectValues = ['object', 'objects', 'obj', 'ob', 'o']; | ||
var onlyArrayValues = ['array', 'arrays', 'arr', 'aray', 'arr', 'a']; | ||
var onlyAnyValues = ['any', 'all', 'everything', 'both', 'either', 'each', 'whatever', 'whatevs', 'e']; | ||
var onlyObjectValues = ["object", "objects", "obj", "ob", "o"]; | ||
var onlyArrayValues = ["array", "arrays", "arr", "aray", "arr", "a"]; | ||
var onlyAnyValues = ["any", "all", "everything", "both", "either", "each", "whatever", "whatevs", "e"]; | ||
var defaults = { | ||
msg: '', | ||
optsVarName: 'given variable' | ||
msg: "", | ||
optsVarName: "given variable" | ||
}; | ||
var opts = Object.assign({}, defaults, originalOpts); | ||
checkTypes(opts, defaults, { | ||
msg: 'util-array-object-or-both/validate(): [THROW_ID_03]', | ||
optsVarName: 'opts', | ||
msg: "util-array-object-or-both/validate(): [THROW_ID_03]", | ||
optsVarName: "opts", | ||
schema: { | ||
msg: ['string', null], | ||
optsVarName: ['string', null] | ||
msg: ["string", null], | ||
optsVarName: ["string", null] | ||
} | ||
}); | ||
if (existy(opts.msg) && opts.msg.length > 0) { | ||
opts.msg = opts.msg.trim() + ' '; | ||
opts.msg = opts.msg.trim() + " "; | ||
} | ||
if (opts.optsVarName !== 'given variable') { | ||
opts.optsVarName = 'variable "' + opts.optsVarName + '"'; | ||
if (opts.optsVarName !== "given variable") { | ||
opts.optsVarName = "variable \"" + opts.optsVarName + "\""; | ||
} | ||
if (includes(onlyObjectValues, str.toLowerCase().trim())) { | ||
return 'object'; | ||
return "object"; | ||
} else if (includes(onlyArrayValues, str.toLowerCase().trim())) { | ||
return 'array'; | ||
return "array"; | ||
} else if (includes(onlyAnyValues, str.toLowerCase().trim())) { | ||
return 'any'; | ||
return "any"; | ||
} | ||
throw new TypeError(opts.msg + 'The ' + opts.optsVarName + ' was customised to an unrecognised value: ' + str + '. Please check it against the API documentation.'); | ||
throw new TypeError(opts.msg + "The " + opts.optsVarName + " was customised to an unrecognised value: " + str + ". Please check it against the API documentation."); | ||
} | ||
module.exports = arrObjOrBoth; |
@@ -5,4 +5,2 @@ import includes from 'lodash.includes'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
function arrObjOrBoth(str, originalOpts) { | ||
@@ -13,45 +11,77 @@ function existy(x) { | ||
if (!existy(str)) { | ||
throw new Error('util-array-object-or-both/validate(): [THROW_ID_01] Please provide a string to work on. Currently it\'s equal to ' + JSON.stringify(str, null, 4)); | ||
throw new Error( | ||
`util-array-object-or-both/validate(): [THROW_ID_01] Please provide a string to work on. Currently it's equal to ${JSON.stringify( | ||
str, | ||
null, | ||
4 | ||
)}` | ||
); | ||
} | ||
if (typeof str !== 'string') { | ||
throw new Error('util-array-object-or-both/validate(): [THROW_ID_02] Input must be string! Currently it\'s ' + (typeof str === 'undefined' ? 'undefined' : _typeof(str)) + ', equal to: ' + JSON.stringify(str, null, 4)); | ||
if (typeof str !== "string") { | ||
throw new Error( | ||
`util-array-object-or-both/validate(): [THROW_ID_02] Input must be string! Currently it's ${typeof str}, equal to: ${JSON.stringify( | ||
str, | ||
null, | ||
4 | ||
)}` | ||
); | ||
} | ||
if (existy(originalOpts) && !isObj(originalOpts)) { | ||
throw new Error('util-array-object-or-both/validate(): [THROW_ID_03] Second argument, options object, must be, well, object! Currenlty it\'s: ' + (typeof originalOpts === 'undefined' ? 'undefined' : _typeof(originalOpts)) + ', equal to: ' + JSON.stringify(originalOpts, null, 4)); | ||
throw new Error( | ||
`util-array-object-or-both/validate(): [THROW_ID_03] Second argument, options object, must be, well, object! Currenlty it's: ${typeof originalOpts}, equal to: ${JSON.stringify( | ||
originalOpts, | ||
null, | ||
4 | ||
)}` | ||
); | ||
} | ||
var onlyObjectValues = ['object', 'objects', 'obj', 'ob', 'o']; | ||
var onlyArrayValues = ['array', 'arrays', 'arr', 'aray', 'arr', 'a']; | ||
var onlyAnyValues = ['any', 'all', 'everything', 'both', 'either', 'each', 'whatever', 'whatevs', 'e']; | ||
const onlyObjectValues = ["object", "objects", "obj", "ob", "o"]; | ||
const onlyArrayValues = ["array", "arrays", "arr", "aray", "arr", "a"]; | ||
const onlyAnyValues = [ | ||
"any", | ||
"all", | ||
"everything", | ||
"both", | ||
"either", | ||
"each", | ||
"whatever", | ||
"whatevs", | ||
"e" | ||
]; | ||
var defaults = { | ||
msg: '', | ||
optsVarName: 'given variable' | ||
const defaults = { | ||
msg: "", | ||
optsVarName: "given variable" | ||
}; | ||
var opts = Object.assign({}, defaults, originalOpts); | ||
const opts = Object.assign({}, defaults, originalOpts); | ||
checkTypes(opts, defaults, { | ||
msg: 'util-array-object-or-both/validate(): [THROW_ID_03]', | ||
optsVarName: 'opts', | ||
msg: "util-array-object-or-both/validate(): [THROW_ID_03]", | ||
optsVarName: "opts", | ||
schema: { | ||
msg: ['string', null], | ||
optsVarName: ['string', null] | ||
msg: ["string", null], | ||
optsVarName: ["string", null] | ||
} | ||
}); | ||
if (existy(opts.msg) && opts.msg.length > 0) { | ||
opts.msg = opts.msg.trim() + ' '; | ||
opts.msg = `${opts.msg.trim()} `; | ||
} | ||
if (opts.optsVarName !== 'given variable') { | ||
opts.optsVarName = 'variable "' + opts.optsVarName + '"'; | ||
if (opts.optsVarName !== "given variable") { | ||
opts.optsVarName = `variable "${opts.optsVarName}"`; | ||
} | ||
if (includes(onlyObjectValues, str.toLowerCase().trim())) { | ||
return 'object'; | ||
return "object"; | ||
} else if (includes(onlyArrayValues, str.toLowerCase().trim())) { | ||
return 'array'; | ||
return "array"; | ||
} else if (includes(onlyAnyValues, str.toLowerCase().trim())) { | ||
return 'any'; | ||
return "any"; | ||
} | ||
throw new TypeError(opts.msg + 'The ' + opts.optsVarName + ' was customised to an unrecognised value: ' + str + '. Please check it against the API documentation.'); | ||
throw new TypeError( | ||
`${opts.msg}The ${ | ||
opts.optsVarName | ||
} was customised to an unrecognised value: ${str}. Please check it against the API documentation.` | ||
); | ||
} | ||
export default arrObjOrBoth; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.arrObjOrBoth=e()}(this,function(){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=1/0,r=9007199254740991,n=1.7976931348623157e308,o=NaN,i="[object Arguments]",a="[object Function]",c="[object GeneratorFunction]",u="[object String]",s="[object Symbol]",f=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,p=/^0o[0-7]+$/i,h=/^(?:0|[1-9]\d*)$/,m=parseInt;function g(t){return t!=t}function b(t,e){return function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}(e,function(e){return t[e]})}var d,v,w=Object.prototype,_=w.hasOwnProperty,j=w.toString,O=w.propertyIsEnumerable,S=(d=Object.keys,v=Object,function(t){return d(v(t))}),T=Math.max;function k(t,e){var r=N(t)||function(t){return function(t){return V(t)&&I(t)}(t)&&_.call(t,"callee")&&(!O.call(t,"callee")||j.call(t)==i)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var a in t)!e&&!_.call(t,a)||o&&("length"==a||E(a,n))||r.push(a);return r}function A(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||w,e!==n)return S(t);var e,r,n,o=[];for(var i in Object(t))_.call(t,i)&&"constructor"!=i&&o.push(i);return o}function E(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||h.test(t))&&t>-1&&t%1==0&&t<e}var N=Array.isArray;function I(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}(t.length)&&!function(t){var e=M(t)?j.call(t):"";return e==a||e==c}(t)}function M(e){var r=void 0===e?"undefined":t(e);return!!e&&("object"==r||"function"==r)}function V(e){return!!e&&"object"==(void 0===e?"undefined":t(e))}var D=function(r,i,a,c){var h;r=I(r)?r:(h=r)?b(h,function(t){return I(t)?k(t):A(t)}(h)):[],a=a&&!c?function(r){var i=function(r){if(!r)return 0===r?r:0;if((r=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==(void 0===e?"undefined":t(e))||V(e)&&j.call(e)==s}(e))return o;if(M(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=M(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(f,"");var n=y.test(e);return n||p.test(e)?m(e.slice(2),n?2:8):l.test(e)?o:+e}(r))===e||r===-e){var i=r<0?-1:1;return i*n}return r==r?r:0}(r),a=i%1;return i==i?a?i-a:i:0}(a):0;var d=r.length;return a<0&&(a=T(d+a,0)),function(t){return"string"==typeof t||!N(t)&&V(t)&&j.call(t)==u}(r)?a<=d&&r.indexOf(i,a)>-1:!!d&&function(t,e,r){if(e!=e)return function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,g,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(r,i,a)>-1},H="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var P,W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C=(function(t,e){var r,n,o,i,a,c,u,s,f,l,y,p,h,m,g,b,d,v,w,_;t.exports=(r="function"==typeof Promise,n="object"===("undefined"==typeof self?"undefined":W(self))?self:H,o="undefined"!=typeof Symbol,i="undefined"!=typeof Map,a="undefined"!=typeof Set,c="undefined"!=typeof WeakMap,u="undefined"!=typeof WeakSet,s="undefined"!=typeof DataView,f=o&&void 0!==Symbol.iterator,l=o&&void 0!==Symbol.toStringTag,y=a&&"function"==typeof Set.prototype.entries,p=i&&"function"==typeof Map.prototype.entries,h=y&&Object.getPrototypeOf((new Set).entries()),m=p&&Object.getPrototypeOf((new Map).entries()),g=f&&"function"==typeof Array.prototype[Symbol.iterator],b=g&&Object.getPrototypeOf([][Symbol.iterator]()),d=f&&"function"==typeof String.prototype[Symbol.iterator],v=d&&Object.getPrototypeOf(""[Symbol.iterator]()),w=8,_=-1,function(t){var e=void 0===t?"undefined":W(t);if("object"!==e)return e;if(null===t)return"null";if(t===n)return"global";if(Array.isArray(t)&&(!1===l||!(Symbol.toStringTag in t)))return"Array";if("object"===("undefined"==typeof window?"undefined":W(window))){if("object"===W(window.location)&&t===window.location)return"Location";if("object"===W(window.document)&&t===window.document)return"Document";if("object"===W(window.navigator)){if("object"===W(window.navigator.mimeTypes)&&t===window.navigator.mimeTypes)return"MimeTypeArray";if("object"===W(window.navigator.plugins)&&t===window.navigator.plugins)return"PluginArray"}if(("function"==typeof window.HTMLElement||"object"===W(window.HTMLElement))&&t instanceof window.HTMLElement){if("BLOCKQUOTE"===t.tagName)return"HTMLQuoteElement";if("TD"===t.tagName)return"HTMLTableDataCellElement";if("TH"===t.tagName)return"HTMLTableHeaderCellElement"}}var o=l&&t[Symbol.toStringTag];if("string"==typeof o)return o;var f=Object.getPrototypeOf(t);return f===RegExp.prototype?"RegExp":f===Date.prototype?"Date":r&&f===Promise.prototype?"Promise":a&&f===Set.prototype?"Set":i&&f===Map.prototype?"Map":u&&f===WeakSet.prototype?"WeakSet":c&&f===WeakMap.prototype?"WeakMap":s&&f===DataView.prototype?"DataView":i&&f===m?"Map Iterator":a&&f===h?"Set Iterator":g&&f===b?"Array Iterator":d&&f===v?"String Iterator":null===f?"Object":Object.prototype.toString.call(t).slice(w,_)})}(P={exports:{}},P.exports),P.exports);function L(t,e,r){if(e!=e)return function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,K,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function R(t,e,r,n){for(var o=r-1,i=t.length;++o<i;)if(n(t[o],e))return o;return-1}function K(t){return t!=t}var x=Array.prototype.splice;function $(t,e,r,n){var o,i=n?R:L,a=-1,c=e.length,u=t;for(t===e&&(e=function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(e)),r&&(u=function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}(t,(o=r,function(t){return o(t)})));++a<c;)for(var s=0,f=e[a],l=r?r(f):f;(s=i(u,l,s,n))>-1;)u!==t&&x.call(u,s,1),x.call(t,s,1);return t}var J=function(t,e){return t&&t.length&&e&&e.length?$(t,e):t},F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q="__lodash_hash_undefined__",B=9007199254740991,G="[object Function]",Q="[object GeneratorFunction]",U=/^\[object .+?Constructor\]$/,z="object"==F(H)&&H&&H.Object===Object&&H,X="object"==("undefined"==typeof self?"undefined":F(self))&&self&&self.Object===Object&&self,Y=z||X||Function("return this")();function Z(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var o=t.length,i=r+(n?1:-1);for(;n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,rt,r);var n=r-1,o=t.length;for(;++n<o;)if(t[n]===e)return n;return-1}(t,e,0)>-1}function tt(t,e,r){for(var n=-1,o=t?t.length:0;++n<o;)if(r(e,t[n]))return!0;return!1}function et(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function rt(t){return t!=t}function nt(t){return function(e){return t(e)}}function ot(t,e){return t.has(e)}var it,at=Array.prototype,ct=Function.prototype,ut=Object.prototype,st=Y["__core-js_shared__"],ft=(it=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||""))?"Symbol(src)_1."+it:"",lt=ct.toString,yt=ut.hasOwnProperty,pt=ut.toString,ht=RegExp("^"+lt.call(yt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=at.splice,gt=Math.max,bt=Math.min,dt=Et(Y,"Map"),vt=Et(Object,"create");function wt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function jt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.__data__=new jt;++e<r;)this.add(t[e])}function St(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function Tt(t){return!(!It(t)||ft&&ft in t)&&(Nt(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?ht:U).test(function(t){if(null!=t){try{return lt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function kt(t){return function(t){return function(t){return!!t&&"object"==(void 0===t?"undefined":F(t))}(t)&&function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=B}(t.length)&&!Nt(t)}(t)}(t)?t:[]}function At(t,e){var r,n,o=t.__data__;return("string"==(n=void 0===(r=e)?"undefined":F(r))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Et(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Tt(r)?r:void 0}function Nt(t){var e=It(t)?pt.call(t):"";return e==G||e==Q}function It(t){var e=void 0===t?"undefined":F(t);return!!t&&("object"==e||"function"==e)}wt.prototype.clear=function(){this.__data__=vt?vt(null):{}},wt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},wt.prototype.get=function(t){var e=this.__data__;if(vt){var r=e[t];return r===q?void 0:r}return yt.call(e,t)?e[t]:void 0},wt.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:yt.call(e,t)},wt.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?q:e,this},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=St(e,t);return!(r<0||(r==e.length-1?e.pop():mt.call(e,r,1),0))},_t.prototype.get=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return St(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,n=St(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},jt.prototype.clear=function(){this.__data__={hash:new wt,map:new(dt||_t),string:new wt}},jt.prototype.delete=function(t){return At(this,t).delete(t)},jt.prototype.get=function(t){return At(this,t).get(t)},jt.prototype.has=function(t){return At(this,t).has(t)},jt.prototype.set=function(t,e){return At(this,t).set(t,e),this},Ot.prototype.add=Ot.prototype.push=function(t){return this.__data__.set(t,q),this},Ot.prototype.has=function(t){return this.__data__.has(t)};var Mt=function(t,e){return e=gt(void 0===e?t.length-1:e,0),function(){for(var r=arguments,n=-1,o=gt(r.length-e,0),i=Array(o);++n<o;)i[n]=r[e+n];n=-1;for(var a=Array(e+1);++n<e;)a[n]=r[n];return a[e]=i,function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,a)}}(function(t){var e=et(t,kt);return e.length&&e[0]===t[0]?function(t,e,r){for(var n=r?tt:Z,o=t[0].length,i=t.length,a=i,c=Array(i),u=1/0,s=[];a--;){var f=t[a];a&&e&&(f=et(f,nt(e))),u=bt(f.length,u),c[a]=!r&&(e||o>=120&&f.length>=120)?new Ot(a&&f):void 0}f=t[0];var l=-1,y=c[0];t:for(;++l<o&&s.length<u;){var p=f[l],h=e?e(p):p;if(p=r||0!==p?p:0,!(y?ot(y,h):n(s,h,r))){for(a=i;--a;){var m=c[a];if(!(m?ot(m,h):n(t[a],h,r)))continue t}y&&y.push(h),s.push(p)}}return s}(e):[]});function Vt(t){return"string"==typeof t?t.length>0?[t]:[]:t}var Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht="[object Object]";var Pt=Function.prototype,Wt=Object.prototype,Ct=Pt.toString,Lt=Wt.hasOwnProperty,Rt=Ct.call(Object),Kt=Wt.toString,xt=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object);var $t=function(t){if(!function(t){return!!t&&"object"==(void 0===t?"undefined":Dt(t))}(t)||Kt.call(t)!=Ht||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=xt(t);if(null===e)return!0;var r=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Ct.call(r)==Rt},Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return function(t,e){function r(t){return null!=t}if(!r(t))throw new Error("util-array-object-or-both/validate(): [THROW_ID_01] Please provide a string to work on. Currently it's equal to "+JSON.stringify(t,null,4));if("string"!=typeof t)throw new Error("util-array-object-or-both/validate(): [THROW_ID_02] Input must be string! Currently it's "+(void 0===t?"undefined":Jt(t))+", equal to: "+JSON.stringify(t,null,4));if(r(e)&&!$t(e))throw new Error("util-array-object-or-both/validate(): [THROW_ID_03] Second argument, options object, must be, well, object! Currenlty it's: "+(void 0===e?"undefined":Jt(e))+", equal to: "+JSON.stringify(e,null,4));var n={msg:"",optsVarName:"given variable"},o=Object.assign({},n,e);if(function(t,e,r){function n(t){return null!=t}function o(t){return"boolean"===C(t)}function i(t){return"string"===C(t)}function a(t){return"Object"===C(t)}var c=["any","anything","every","everything","all","whatever","whatevs"],u=Array.isArray;if(0===arguments.length)throw new Error("check-types-mini: [THROW_ID_01] Missing all arguments!");if(1===arguments.length)throw new Error("check-types-mini: [THROW_ID_02] Missing second argument!");var s=a(e)?e:{},f={ignoreKeys:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"},l=void 0;if(!i((l=n(r)&&a(r)?Object.assign({},f,r):Object.assign({},f)).msg))throw new Error("check-types-mini: [THROW_ID_03] opts.msg must be string! Currently it's: "+C(l.msg)+", equal to "+JSON.stringify(l.msg,null,4));if(l.msg=l.msg.trim(),":"===l.msg[l.msg.length-1]&&(l.msg=l.msg.slice(0,l.msg.length-1)),!i(l.optsVarName))throw new Error("check-types-mini: [THROW_ID_04] opts.optsVarName must be string! Currently it's: "+C(l.optsVarName)+", equal to "+JSON.stringify(l.optsVarName,null,4));if(l.ignoreKeys=Vt(l.ignoreKeys),l.acceptArraysIgnore=Vt(l.acceptArraysIgnore),!u(l.ignoreKeys))throw new TypeError("check-types-mini: [THROW_ID_05] opts.ignoreKeys should be an array, currently it's: "+C(l.ignoreKeys));if(!o(l.acceptArrays))throw new TypeError("check-types-mini: [THROW_ID_06] opts.acceptArrays should be a Boolean, currently it's: "+C(l.acceptArrays));if(!u(l.acceptArraysIgnore))throw new TypeError("check-types-mini: [THROW_ID_07] opts.acceptArraysIgnore should be an array, currently it's: "+C(l.acceptArraysIgnore));if(!o(l.enforceStrictKeyset))throw new TypeError("check-types-mini: [THROW_ID_08] opts.enforceStrictKeyset should be a Boolean, currently it's: "+C(l.enforceStrictKeyset));if(Object.keys(l.schema).forEach(function(t){u(l.schema[t])||(l.schema[t]=[l.schema[t]]),l.schema[t]=l.schema[t].map(String).map(function(t){return t.toLowerCase()}).map(function(t){return t.trim()})}),l.enforceStrictKeyset)if(n(l.schema)&&Object.keys(l.schema).length>0){if(0!==J(Object.keys(t),Object.keys(s).concat(Object.keys(l.schema))).length)throw new TypeError(l.msg+": "+l.optsVarName+".enforceStrictKeyset is on and the following keys are not covered by schema and/or reference objects: "+JSON.stringify(J(Object.keys(t),Object.keys(s).concat(Object.keys(l.schema))),null,4))}else{if(!(n(s)&&Object.keys(s).length>0))throw new TypeError(l.msg+": Both "+l.optsVarName+".schema and reference objects are missing! We don't have anything to match the keys as you requested via opts.enforceStrictKeyset!");if(0!==J(Object.keys(t),Object.keys(s)).length)throw new TypeError(l.msg+": The input object has keys that are not covered by reference object: "+JSON.stringify(J(Object.keys(t),Object.keys(s)),null,4));if(0!==J(Object.keys(s),Object.keys(t)).length)throw new TypeError(l.msg+": The reference object has keys that are not present in the input object: "+JSON.stringify(J(Object.keys(s),Object.keys(t)),null,4))}Object.keys(t).forEach(function(e){if(n(l.schema)&&Object.prototype.hasOwnProperty.call(l.schema,e)){if(l.schema[e]=Vt(l.schema[e]).map(String).map(function(t){return t.toLowerCase()}),!(Mt(l.schema[e],c).length||(!0===t[e]||!1===t[e]||l.schema[e].includes(C(t[e]).toLowerCase()))&&(!0!==t[e]&&!1!==t[e]||l.schema[e].includes(String(t[e]))||l.schema[e].includes("boolean")))){if(!u(t[e])||!l.acceptArrays)throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" was customised to "+JSON.stringify(t[e],null,4)+" which is not among the allowed types in schema ("+l.schema[e]+") but "+C(t[e]));for(var r=0,o=t[e].length;r<o;r++)if(!l.schema[e].includes(C(t[e][r]).toLowerCase()))throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" is of type "+C(t[e][r]).toLowerCase()+", but only the following are allowed in "+l.optsVarName+".schema: "+l.schema[e])}}else if(n(s)&&Object.prototype.hasOwnProperty.call(s,e)&&C(t[e])!==C(s[e])&&!l.ignoreKeys.includes(e)){if(!l.acceptArrays||!u(t[e])||l.acceptArraysIgnore.includes(e))throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" was customised to "+JSON.stringify(t[e],null,4)+" which is not "+C(s[e])+" but "+C(t[e]));if(!t[e].every(function(t){return C(t)===C(s[e])}))throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" was customised to be array, but not all of its elements are "+C(s[e])+"-type")}})}(o,n,{msg:"util-array-object-or-both/validate(): [THROW_ID_03]",optsVarName:"opts",schema:{msg:["string",null],optsVarName:["string",null]}}),r(o.msg)&&o.msg.length>0&&(o.msg=o.msg.trim()+" "),"given variable"!==o.optsVarName&&(o.optsVarName='variable "'+o.optsVarName+'"'),D(["object","objects","obj","ob","o"],t.toLowerCase().trim()))return"object";if(D(["array","arrays","arr","aray","arr","a"],t.toLowerCase().trim()))return"array";if(D(["any","all","everything","both","either","each","whatever","whatevs","e"],t.toLowerCase().trim()))return"any";throw new TypeError(o.msg+"The "+o.optsVarName+" was customised to an unrecognised value: "+t+". Please check it against the API documentation.")}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.utilArrayObjectOrBoth=e()}(this,function(){"use strict";var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=1/0,o=9007199254740991,y=17976931348623157e292,p=NaN,u="[object Arguments]",i="[object Function]",a="[object GeneratorFunction]",h="[object String]",m="[object Symbol]",g=/^\s+|\s+$/g,b=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,v=/^0o[0-7]+$/i,r=/^(?:0|[1-9]\d*)$/,w=parseInt;function _(t){return t!=t}function j(e,t){return function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}(t,function(t){return e[t]})}var e,n,c=Object.prototype,s=c.hasOwnProperty,O=c.toString,S=c.propertyIsEnumerable,T=(e=Object.keys,n=Object,function(t){return e(n(t))}),k=Math.max;function A(t,e){var r,n,o=I(t)||D(n=r=t)&&M(n)&&s.call(r,"callee")&&(!S.call(r,"callee")||O.call(r)==u)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],i=o.length,a=!!i;for(var c in t)!e&&!s.call(t,c)||a&&("length"==c||N(c,i))||o.push(c);return o}function E(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||c,e!==n)return T(t);var e,r,n,o=[];for(var i in Object(t))s.call(t,i)&&"constructor"!=i&&o.push(i);return o}function N(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||r.test(t))&&-1<t&&t%1==0&&t<e}var I=Array.isArray;function M(t){return null!=t&&("number"==typeof(n=t.length)&&-1<n&&n%1==0&&n<=o)&&!((r=V(e=t)?O.call(e):"")==i||r==a);var e,r,n}function V(t){var e=void 0===t?"undefined":f(t);return!!t&&("object"==e||"function"==e)}function D(t){return!!t&&"object"==(void 0===t?"undefined":f(t))}var H=function(t,e,r,n){var o,i,a,c;t=M(t)?t:(o=t)?j(o,M(i=o)?A(i):E(i)):[],r=r&&!n?(a=function(t){if(!t)return 0===t?t:0;if((t=function(t){if("number"==typeof t)return t;if("symbol"==(void 0===(e=t)?"undefined":f(e))||D(e)&&O.call(e)==m)return p;var e;if(V(t)){var r="function"==typeof t.valueOf?t.valueOf():t;t=V(r)?r+"":r}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(g,"");var n=d.test(t);return n||v.test(t)?w(t.slice(2),n?2:8):b.test(t)?p:+t}(t))===l||t===-l){var e=t<0?-1:1;return e*y}return t==t?t:0}(r),c=a%1,a==a?c?a-c:a:0):0;var u,s=t.length;return r<0&&(r=k(s+r,0)),"string"==typeof(u=t)||!I(u)&&D(u)&&O.call(u)==h?r<=s&&-1<t.indexOf(e,r):!!s&&-1<function(t,e,r){if(e!=e)return function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,_,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r)},P="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var t,W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C=(function(t,e){var o,i,r,a,c,u,s,f,n,l,y,p,h,m,g,b,d,v;t.exports=(o="function"==typeof Promise,i="object"===("undefined"==typeof self?"undefined":W(self))?self:P,r="undefined"!=typeof Symbol,a="undefined"!=typeof Map,c="undefined"!=typeof Set,u="undefined"!=typeof WeakMap,s="undefined"!=typeof WeakSet,f="undefined"!=typeof DataView,n=r&&void 0!==Symbol.iterator,l=r&&void 0!==Symbol.toStringTag,y=c&&"function"==typeof Set.prototype.entries,p=a&&"function"==typeof Map.prototype.entries,h=y&&Object.getPrototypeOf((new Set).entries()),m=p&&Object.getPrototypeOf((new Map).entries()),g=n&&"function"==typeof Array.prototype[Symbol.iterator],b=g&&Object.getPrototypeOf([][Symbol.iterator]()),d=n&&"function"==typeof String.prototype[Symbol.iterator],v=d&&Object.getPrototypeOf(""[Symbol.iterator]()),function(t){var e=void 0===t?"undefined":W(t);if("object"!==e)return e;if(null===t)return"null";if(t===i)return"global";if(Array.isArray(t)&&(!1===l||!(Symbol.toStringTag in t)))return"Array";if("object"===("undefined"==typeof window?"undefined":W(window))&&null!==window){if("object"===W(window.location)&&t===window.location)return"Location";if("object"===W(window.document)&&t===window.document)return"Document";if("object"===W(window.navigator)){if("object"===W(window.navigator.mimeTypes)&&t===window.navigator.mimeTypes)return"MimeTypeArray";if("object"===W(window.navigator.plugins)&&t===window.navigator.plugins)return"PluginArray"}if(("function"==typeof window.HTMLElement||"object"===W(window.HTMLElement))&&t instanceof window.HTMLElement){if("BLOCKQUOTE"===t.tagName)return"HTMLQuoteElement";if("TD"===t.tagName)return"HTMLTableDataCellElement";if("TH"===t.tagName)return"HTMLTableHeaderCellElement"}}var r=l&&t[Symbol.toStringTag];if("string"==typeof r)return r;var n=Object.getPrototypeOf(t);return n===RegExp.prototype?"RegExp":n===Date.prototype?"Date":o&&n===Promise.prototype?"Promise":c&&n===Set.prototype?"Set":a&&n===Map.prototype?"Map":s&&n===WeakSet.prototype?"WeakSet":u&&n===WeakMap.prototype?"WeakMap":f&&n===DataView.prototype?"DataView":a&&n===m?"Map Iterator":c&&n===h?"Set Iterator":g&&n===b?"Array Iterator":d&&n===v?"String Iterator":null===n?"Object":Object.prototype.toString.call(t).slice(8,-1)})}(t={exports:{}},t.exports),t.exports);function L(t,e,r){if(e!=e)return function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,K,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function R(t,e,r,n){for(var o=r-1,i=t.length;++o<i;)if(n(t[o],e))return o;return-1}function K(t){return t!=t}var x=Array.prototype.splice;function $(t,e,r,n){var o,i=n?R:L,a=-1,c=e.length,u=t;for(t===e&&(e=function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(e)),r&&(u=function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}(t,(o=r,function(t){return o(t)})));++a<c;)for(var s=0,f=e[a],l=r?r(f):f;-1<(s=i(u,l,s,n));)u!==t&&x.call(u,s,1),x.call(t,s,1);return t}var J=function(t,e){return t&&t.length&&e&&e.length?$(t,e):t},F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q="__lodash_hash_undefined__",B=9007199254740991,G="[object Function]",Q="[object GeneratorFunction]",U=/^\[object .+?Constructor\]$/,z="object"==F(P)&&P&&P.Object===Object&&P,X="object"==("undefined"==typeof self?"undefined":F(self))&&self&&self.Object===Object&&self,Y=z||X||Function("return this")();function Z(t,e){return!!(t?t.length:0)&&-1<function(t,e,r){if(e!=e)return function(t,e,r,n){var o=t.length,i=r+(n?1:-1);for(;n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,rt,r);var n=r-1,o=t.length;for(;++n<o;)if(t[n]===e)return n;return-1}(t,e,0)}function tt(t,e,r){for(var n=-1,o=t?t.length:0;++n<o;)if(r(e,t[n]))return!0;return!1}function et(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function rt(t){return t!=t}function nt(e){return function(t){return e(t)}}function ot(t,e){return t.has(e)}var it,at,ct,ut=Array.prototype,st=Function.prototype,ft=Object.prototype,lt=Y["__core-js_shared__"],yt=(it=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||""))?"Symbol(src)_1."+it:"",pt=st.toString,ht=ft.hasOwnProperty,mt=ft.toString,gt=RegExp("^"+pt.call(ht).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bt=ut.splice,dt=Math.max,vt=Math.min,wt=It(Y,"Map"),_t=It(Object,"create");function jt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function St(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.__data__=new St;++e<r;)this.add(t[e])}function kt(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function At(t){return!(!Vt(t)||(e=t,yt&&yt in e))&&(Mt(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?gt:U).test(function(t){if(null!=t){try{return pt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function Et(t){return(o=e=t)&&"object"==(void 0===o?"undefined":F(o))&&(null!=(r=e)&&("number"==typeof(n=r.length)&&-1<n&&n%1==0&&n<=B)&&!Mt(r))?t:[];var e,r,n,o}function Nt(t,e){var r,n,o=t.__data__;return("string"==(n=void 0===(r=e)?"undefined":F(r))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function It(t,e){var r,n,o=(n=e,null==(r=t)?void 0:r[n]);return At(o)?o:void 0}function Mt(t){var e=Vt(t)?mt.call(t):"";return e==G||e==Q}function Vt(t){var e=void 0===t?"undefined":F(t);return!!t&&("object"==e||"function"==e)}jt.prototype.clear=function(){this.__data__=_t?_t(null):{}},jt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},jt.prototype.get=function(t){var e=this.__data__;if(_t){var r=e[t];return r===q?void 0:r}return ht.call(e,t)?e[t]:void 0},jt.prototype.has=function(t){var e=this.__data__;return _t?void 0!==e[t]:ht.call(e,t)},jt.prototype.set=function(t,e){return this.__data__[t]=_t&&void 0===e?q:e,this},Ot.prototype.clear=function(){this.__data__=[]},Ot.prototype.delete=function(t){var e=this.__data__,r=kt(e,t);return!(r<0||(r==e.length-1?e.pop():bt.call(e,r,1),0))},Ot.prototype.get=function(t){var e=this.__data__,r=kt(e,t);return r<0?void 0:e[r][1]},Ot.prototype.has=function(t){return-1<kt(this.__data__,t)},Ot.prototype.set=function(t,e){var r=this.__data__,n=kt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},St.prototype.clear=function(){this.__data__={hash:new jt,map:new(wt||Ot),string:new jt}},St.prototype.delete=function(t){return Nt(this,t).delete(t)},St.prototype.get=function(t){return Nt(this,t).get(t)},St.prototype.has=function(t){return Nt(this,t).has(t)},St.prototype.set=function(t,e){return Nt(this,t).set(t,e),this},Tt.prototype.add=Tt.prototype.push=function(t){return this.__data__.set(t,q),this},Tt.prototype.has=function(t){return this.__data__.has(t)};var Dt=(at=function(t){var e=et(t,Et);return e.length&&e[0]===t[0]?function(t,e,r){for(var n=r?tt:Z,o=t[0].length,i=t.length,a=i,c=Array(i),u=1/0,s=[];a--;){var f=t[a];a&&e&&(f=et(f,nt(e))),u=vt(f.length,u),c[a]=!r&&(e||120<=o&&120<=f.length)?new Tt(a&&f):void 0}f=t[0];var l=-1,y=c[0];t:for(;++l<o&&s.length<u;){var p=f[l],h=e?e(p):p;if(p=r||0!==p?p:0,!(y?ot(y,h):n(s,h,r))){for(a=i;--a;){var m=c[a];if(!(m?ot(m,h):n(t[a],h,r)))continue t}y&&y.push(h),s.push(p)}}return s}(e):[]},ct=dt(void 0===ct?at.length-1:ct,0),function(){for(var t=arguments,e=-1,r=dt(t.length-ct,0),n=Array(r);++e<r;)n[e]=t[ct+e];e=-1;for(var o=Array(ct+1);++e<ct;)o[e]=t[e];return o[ct]=n,function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(at,this,o)});function Ht(t){return"string"==typeof t?0<t.length?[t]:[]:t}var Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var Wt,Ct,Lt=Function.prototype,Rt=Object.prototype,Kt=Lt.toString,xt=Rt.hasOwnProperty,$t=Kt.call(Object),Jt=Rt.toString,Ft=(Wt=Object.getPrototypeOf,Ct=Object,function(t){return Wt(Ct(t))});var qt=function(t){if(!(e=t)||"object"!=(void 0===e?"undefined":Pt(e))||"[object Object]"!=Jt.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e,r=Ft(t);if(null===r)return!0;var n=xt.call(r,"constructor")&&r.constructor;return"function"==typeof n&&n instanceof n&&Kt.call(n)==$t},Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return function(t,e){function r(t){return null!=t}if(!r(t))throw new Error("util-array-object-or-both/validate(): [THROW_ID_01] Please provide a string to work on. Currently it's equal to "+JSON.stringify(t,null,4));if("string"!=typeof t)throw new Error("util-array-object-or-both/validate(): [THROW_ID_02] Input must be string! Currently it's "+(void 0===t?"undefined":Bt(t))+", equal to: "+JSON.stringify(t,null,4));if(r(e)&&!qt(e))throw new Error("util-array-object-or-both/validate(): [THROW_ID_03] Second argument, options object, must be, well, object! Currenlty it's: "+(void 0===e?"undefined":Bt(e))+", equal to: "+JSON.stringify(e,null,4));var n={msg:"",optsVarName:"given variable"},o=Object.assign({},n,e);if(function(n,t,e){function o(t){return null!=t}function r(t){return"boolean"===C(t)}function i(t){return"string"===C(t)}function a(t){return"Object"===C(t)}var c=["any","anything","every","everything","all","whatever","whatevs"],u=Array.isArray;if(0===arguments.length)throw new Error("check-types-mini: [THROW_ID_01] Missing all arguments!");if(1===arguments.length)throw new Error("check-types-mini: [THROW_ID_02] Missing second argument!");var s=a(t)?t:{},f={ignoreKeys:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"},l=void 0;if(!i((l=o(e)&&a(e)?Object.assign({},f,e):Object.assign({},f)).msg))throw new Error("check-types-mini: [THROW_ID_03] opts.msg must be string! Currently it's: "+C(l.msg)+", equal to "+JSON.stringify(l.msg,null,4));if(l.msg=l.msg.trim(),":"===l.msg[l.msg.length-1]&&(l.msg=l.msg.slice(0,l.msg.length-1)),!i(l.optsVarName))throw new Error("check-types-mini: [THROW_ID_04] opts.optsVarName must be string! Currently it's: "+C(l.optsVarName)+", equal to "+JSON.stringify(l.optsVarName,null,4));if(l.ignoreKeys=Ht(l.ignoreKeys),l.acceptArraysIgnore=Ht(l.acceptArraysIgnore),!u(l.ignoreKeys))throw new TypeError("check-types-mini: [THROW_ID_05] opts.ignoreKeys should be an array, currently it's: "+C(l.ignoreKeys));if(!r(l.acceptArrays))throw new TypeError("check-types-mini: [THROW_ID_06] opts.acceptArrays should be a Boolean, currently it's: "+C(l.acceptArrays));if(!u(l.acceptArraysIgnore))throw new TypeError("check-types-mini: [THROW_ID_07] opts.acceptArraysIgnore should be an array, currently it's: "+C(l.acceptArraysIgnore));if(!r(l.enforceStrictKeyset))throw new TypeError("check-types-mini: [THROW_ID_08] opts.enforceStrictKeyset should be a Boolean, currently it's: "+C(l.enforceStrictKeyset));if(Object.keys(l.schema).forEach(function(t){u(l.schema[t])||(l.schema[t]=[l.schema[t]]),l.schema[t]=l.schema[t].map(String).map(function(t){return t.toLowerCase()}).map(function(t){return t.trim()})}),l.enforceStrictKeyset)if(o(l.schema)&&0<Object.keys(l.schema).length){if(0!==J(Object.keys(n),Object.keys(s).concat(Object.keys(l.schema))).length)throw new TypeError(l.msg+": "+l.optsVarName+".enforceStrictKeyset is on and the following keys are not covered by schema and/or reference objects: "+JSON.stringify(J(Object.keys(n),Object.keys(s).concat(Object.keys(l.schema))),null,4))}else{if(!(o(s)&&0<Object.keys(s).length))throw new TypeError(l.msg+": Both "+l.optsVarName+".schema and reference objects are missing! We don't have anything to match the keys as you requested via opts.enforceStrictKeyset!");if(0!==J(Object.keys(n),Object.keys(s)).length)throw new TypeError(l.msg+": The input object has keys that are not covered by reference object: "+JSON.stringify(J(Object.keys(n),Object.keys(s)),null,4));if(0!==J(Object.keys(s),Object.keys(n)).length)throw new TypeError(l.msg+": The reference object has keys that are not present in the input object: "+JSON.stringify(J(Object.keys(s),Object.keys(n)),null,4))}Object.keys(n).forEach(function(e){if(o(l.schema)&&Object.prototype.hasOwnProperty.call(l.schema,e)){if(l.schema[e]=Ht(l.schema[e]).map(String).map(function(t){return t.toLowerCase()}),!(Dt(l.schema[e],c).length||(!0===n[e]||!1===n[e]||l.schema[e].includes(C(n[e]).toLowerCase()))&&(!0!==n[e]&&!1!==n[e]||l.schema[e].includes(String(n[e]))||l.schema[e].includes("boolean")))){if(!u(n[e])||!l.acceptArrays)throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" was customised to "+JSON.stringify(n[e],null,4)+" which is not among the allowed types in schema ("+l.schema[e]+") but "+C(n[e]));for(var t=0,r=n[e].length;t<r;t++)if(!l.schema[e].includes(C(n[e][t]).toLowerCase()))throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" is of type "+C(n[e][t]).toLowerCase()+", but only the following are allowed in "+l.optsVarName+".schema: "+l.schema[e])}}else if(o(s)&&Object.prototype.hasOwnProperty.call(s,e)&&C(n[e])!==C(s[e])&&!l.ignoreKeys.includes(e)){if(!l.acceptArrays||!u(n[e])||l.acceptArraysIgnore.includes(e))throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" was customised to "+JSON.stringify(n[e],null,4)+" which is not "+C(s[e])+" but "+C(n[e]));if(!n[e].every(function(t){return C(t)===C(s[e])}))throw new TypeError(l.msg+": "+l.optsVarName+"."+e+" was customised to be array, but not all of its elements are "+C(s[e])+"-type")}})}(o,n,{msg:"util-array-object-or-both/validate(): [THROW_ID_03]",optsVarName:"opts",schema:{msg:["string",null],optsVarName:["string",null]}}),r(o.msg)&&0<o.msg.length&&(o.msg=o.msg.trim()+" "),"given variable"!==o.optsVarName&&(o.optsVarName='variable "'+o.optsVarName+'"'),H(["object","objects","obj","ob","o"],t.toLowerCase().trim()))return"object";if(H(["array","arrays","arr","aray","arr","a"],t.toLowerCase().trim()))return"array";if(H(["any","all","everything","both","either","each","whatever","whatevs","e"],t.toLowerCase().trim()))return"any";throw new TypeError(o.msg+"The "+o.optsVarName+" was customised to an unrecognised value: "+t+". Please check it against the API documentation.")}}); |
{ | ||
"name": "util-array-object-or-both", | ||
"version": "2.0.3", | ||
"version": "2.1.0", | ||
"description": "Validate and normalise user choice: array, object or both?", | ||
@@ -30,9 +30,14 @@ "license": "MIT", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"dev": "rollup -c -w", | ||
"precommit": "npm test", | ||
"dev": "rollup -c --dev --silent", | ||
"format": "prettier '*.{js,ts,css,less,scss,vue,gql,md}' --write && ./node_modules/.bin/eslint src/*.js test/*.js --fix", | ||
"precommit": "npm run format && npm test", | ||
"prepare": "npm run build", | ||
"pretest": "npm run build", | ||
"test": "./node_modules/.bin/eslint src/*.js test/*.js && nyc --reporter=html --reporter=text ava" | ||
"test": "./node_modules/.bin/eslint src/*.js test/*.js && nyc --require esm --reporter=html --reporter=text ava" | ||
}, | ||
"ava": { | ||
"compileEnhancements": false, | ||
"require": [ | ||
"esm" | ||
], | ||
"verbose": true | ||
@@ -45,2 +50,6 @@ }, | ||
}, | ||
"esm": { | ||
"await": true, | ||
"cjs": true | ||
}, | ||
"keywords": [ | ||
@@ -78,18 +87,18 @@ "validate", | ||
"contribution_types": [ | ||
"Answering Questions", | ||
"Blogposts", | ||
"Bug reports*", | ||
"Code*", | ||
"Bug reports", | ||
"Code", | ||
"Design", | ||
"Documentation*", | ||
"Event Organizers", | ||
"Documentation", | ||
"Event Organizing", | ||
"Examples", | ||
"Financial Support", | ||
"Funding/Grant Finders", | ||
"Ideas & Planning", | ||
"Financial", | ||
"Funding Finding", | ||
"Ideas, Planning, & Feedback", | ||
"Infrastructure (Hosting, Build-Tools, etc)", | ||
"Plugin/utility libraries", | ||
"Answering Questions", | ||
"Reviewed Pull Requests", | ||
"Talks", | ||
"Tests*", | ||
"Tests", | ||
"Tools", | ||
@@ -114,5 +123,20 @@ "Translation", | ||
}, | ||
"files": { | ||
"delete": [], | ||
"write_hard": [ | ||
{ | ||
"contents": "", | ||
"name": "" | ||
} | ||
], | ||
"write_soft": [ | ||
{ | ||
"contents": "", | ||
"name": "" | ||
} | ||
] | ||
}, | ||
"header": { | ||
"dontQuoteDescription": false, | ||
"rightFloatedBadge": "" | ||
"rightFloatedBadge": [] | ||
}, | ||
@@ -132,7 +156,8 @@ "licence": { | ||
"label": "" | ||
} | ||
}, | ||
"devDependencies": [] | ||
} | ||
}, | ||
"dependencies": { | ||
"check-types-mini": "^3.1.0", | ||
"check-types-mini": "latest", | ||
"lodash.includes": "*", | ||
@@ -142,18 +167,21 @@ "lodash.isplainobject": "*" | ||
"devDependencies": { | ||
"ava": "*", | ||
"babel-preset-env": "^1.6.1", | ||
"coveralls": "*", | ||
"eslint": "^4.16.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-ava": "^4.5.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"husky": "*", | ||
"nyc": "*", | ||
"rollup": "^0.55.3", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-commonjs": "^8.3.0", | ||
"rollup-plugin-node-resolve": "^3.0.2", | ||
"rollup-plugin-uglify": "^3.0.0", | ||
"uglify-es": "^3.3.9" | ||
"ava": "latest", | ||
"babel-preset-env": "latest", | ||
"coveralls": "latest", | ||
"eslint": "^4.19.1", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-ava": "^4.5.1", | ||
"eslint-plugin-import": "^2.12.0", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"esm": "latest", | ||
"husky": "latest", | ||
"nyc": "latest", | ||
"prettier": "latest", | ||
"rollup": "^0.59.1", | ||
"rollup-plugin-babel": "^3.0.4", | ||
"rollup-plugin-commonjs": "^9.1.3", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-strip": "^1.1.1", | ||
"rollup-plugin-uglify": "^4.0.0" | ||
} | ||
} |
105
readme.md
# util-array-object-or-both | ||
<a href="https://github.com/revelt/eslint-on-airbnb-base-badge" style="float: right; padding: 0 0 20px 20px;"><img src="https://cdn.rawgit.com/revelt/eslint-on-airbnb-base-badge/0c3e46c9/lint-badge.svg" alt="ESLint on airbnb-base with caveats" width="100" align="right"></a> | ||
> Validate and normalise user choice: array, object or both? | ||
[![Minimum Node version required][node-img]][node-url] | ||
[![Link to npm page][npm-img]][npm-url] | ||
[![Build Status][travis-img]][travis-url] | ||
@@ -18,2 +15,3 @@ [![Coverage][cov-img]][cov-url] | ||
[![Test in browser][runkit-img]][runkit-url] | ||
[![Code style: prettier][prettier-img]][prettier-url] | ||
[![MIT License][license-img]][license-url] | ||
@@ -23,2 +21,4 @@ | ||
<!-- prettier-ignore-start --> | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
@@ -38,2 +38,4 @@ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
<!-- prettier-ignore-end --> | ||
## Install | ||
@@ -47,5 +49,5 @@ | ||
// consume via a CommonJS require: | ||
const arrObjOrBoth = require('util-array-object-or-both') | ||
const arrObjOrBoth = require("util-array-object-or-both"); | ||
// or as an ES Module: | ||
import arrObjOrBoth from 'util-array-object-or-both' | ||
import arrObjOrBoth from "util-array-object-or-both"; | ||
``` | ||
@@ -55,7 +57,7 @@ | ||
Type | Key in `package.json` | Path | Size | ||
----------------|-----------------------|-------|-------- | ||
Main export - **CommonJS version**, transpiled to ES5, contains `require` and `module.exports` | `main` | `dist/util-array-object-or-both.cjs.js` | 3 KB | ||
**ES module** build that Webpack/Rollup understands. Untranspiled ES6 code with `import`/`export`. | `module` | `dist/util-array-object-or-both.esm.js` | 2 KB | ||
**UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/util-array-object-or-both.umd.js` | 18 KB | ||
| Type | Key in `package.json` | Path | Size | | ||
| ------------------------------------------------------------------------------------------------------- | --------------------- | --------------------------------------- | ---------- | | ||
| Main export - **CommonJS version**, transpiled to ES5, contains `require` and `module.exports` | `main` | `dist/util-array-object-or-both.cjs.js` | 3 KB | | ||
| **ES module** build that Webpack/Rollup understands. Untranspiled ES6 code with `import`/`export`. | `module` | `dist/util-array-object-or-both.esm.js` | 2 KB | | ||
| **UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/util-array-object-or-both.umd.js` | 17 KB | | ||
@@ -68,19 +70,19 @@ **[⬆ back to top](#)** | ||
- Allow users to input the preference in many ways: for example, for `array`, I also want to accept: `Arrays`, `add`, `ARR`, `a`. Similar thing goes for options `object` and `any`. | ||
- Normalise the choice - recognise it and set it to one of the three following strings: `array`, `object` or `any`. This is necessary because we want set values to use in our programs. You can't have five values for `array` in an IF statement, for example. | ||
- When a user sets the preference to unrecognised string, I want to `throw` a meaningful error message. Technically this will be achieved using an options object. | ||
- Enforce lowercase and trim and input, to maximise the input possibilities | ||
* Allow users to input the preference in many ways: for example, for `array`, I also want to accept: `Arrays`, `add`, `ARR`, `a`. Similar thing goes for options `object` and `any`. | ||
* Normalise the choice - recognise it and set it to one of the three following strings: `array`, `object` or `any`. This is necessary because we want set values to use in our programs. You can't have five values for `array` in an IF statement, for example. | ||
* When a user sets the preference to unrecognised string, I want to `throw` a meaningful error message. Technically this will be achieved using an options object. | ||
* Enforce lowercase and trim and input, to maximise the input possibilities | ||
<br> | Assumed to be an array-type | object-type | either type | ||
------------|------------|---------------|--------------- | ||
**Input string:** | `array` | `object` | `any` | ||
<br> | `arrays` | `objects` | `all` | ||
<br> | `arr` | `obj` | `everything` | ||
<br> | `aray` | `ob` | `both` | ||
<br> | `arr` | `o` | `either` | ||
<br> | `a` | | `each` | ||
<br> | | | `whatever` | ||
<br> | | | `e` | ||
<br> | `----` | `----` | `----` | ||
**Output string:** | `array` | `object` | `any` | ||
| <br> | Assumed to be an array-type | object-type | either type | | ||
| ------------------ | --------------------------- | ----------- | ------------ | | ||
| **Input string:** | `array` | `object` | `any` | | ||
| <br> | `arrays` | `objects` | `all` | | ||
| <br> | `arr` | `obj` | `everything` | | ||
| <br> | `aray` | `ob` | `both` | | ||
| <br> | `arr` | `o` | `either` | | ||
| <br> | `a` | | `each` | | ||
| <br> | | | `whatever` | | ||
| <br> | | | `e` | | ||
| <br> | `----` | `----` | `----` | | ||
| **Output string:** | `array` | `object` | `any` | | ||
@@ -93,6 +95,6 @@ **[⬆ back to top](#)** | ||
Input argument | Type | Obligatory? | Description | ||
-----------------|--------------|-------------|------------- | ||
`input` | String | yes | Let users choose from variations of "array", "object" or "both". See above. | ||
`opts` | Plain object | no | Optional Options Object. See below for its API. | ||
| Input argument | Type | Obligatory? | Description | | ||
| -------------- | ------------ | ----------- | --------------------------------------------------------------------------- | | ||
| `input` | String | yes | Let users choose from variations of "array", "object" or "both". See above. | | ||
| `opts` | Plain object | no | Optional Options Object. See below for its API. | | ||
@@ -103,12 +105,12 @@ Options object lets you customise the `throw`n error message. It's format is the following: | ||
`options` object's key | Type | Obligatory? | Default | Description | ||
-----------------------|----------|-------------|------------------|---------------------- | ||
{ | | | | | ||
`msg` | String | no | `` | Append the message in front of the thrown error. | ||
`optsVarName` | String | no | `given variable` | The name of the variable we are checking here. | ||
} | | | | | ||
| `options` object's key | Type | Obligatory? | Default | Description | | ||
| ---------------------- | ------ | ----------- | ----------------------------------------------------- | ---------------------------------------------- | | ||
| { | | | | | ||
| `msg` | String | no | `` | Append the message in front of the thrown error. | | ||
| `optsVarName` | String | no | `given variable` | The name of the variable we are checking here. | | ||
| } | | | | | ||
For example, set `optsVarName` to `opts.only` and set `msg` to `posthtml-ast-delete-key/deleteKey(): [THROW_ID_01]` and the error message `throw`n if user misconfigures the setting will be, for example: | ||
For example, set `optsVarName` to `opts.only` and set `msg` to `ast-delete-key/deleteKey(): [THROW_ID_01]` and the error message `throw`n if user misconfigures the setting will be, for example: | ||
posthtml-ast-delete-key/deleteKey(): [THROW_ID_01] The variable "opts.only" was customised to an unrecognised value: sweetcarrots. Please check it against the API documentation. | ||
ast-delete-key/deleteKey(): [THROW_ID_01] The variable "opts.only" was customised to an unrecognised value: sweetcarrots. Please check it against the API documentation. | ||
@@ -180,6 +182,7 @@ **[⬆ back to top](#)** | ||
I'm going to use it in: | ||
- [ast-monkey](https://github.com/codsen/ast-monkey) | ||
- [json-variables](https://github.com/codsen/json-variables) | ||
- [posthtml-ast-delete-key](https://github.com/codsen/posthtml-ast-delete-key) | ||
* [ast-monkey](https://github.com/codsen/ast-monkey) | ||
* [json-variables](https://github.com/codsen/json-variables) | ||
* [ast-delete-key](https://github.com/codsen/ast-delete-key) | ||
and others. So, it's not that niche as it might seem! | ||
@@ -193,5 +196,5 @@ | ||
* If you tried to use this library but it misbehaves, or **you need an advice setting it up**, and its readme doesn't make sense, just document it and raise an [issue on this repo](https://github.com/codsen/util-array-object-or-both/issues). | ||
* If you tried to use this library but it misbehaves, or **you need advice setting it up**, and its readme doesn't make sense, just document it and raise an [issue on this repo](https://github.com/codsen/util-array-object-or-both/issues). | ||
* If you would like to **add or change some features**, just fork it, hack away, and file a pull request. We'll do our best to merge it quickly. Code style is `airbnb-base`, only without semicolons. If you use a good code editor, it will pick up the established ESLint setup. | ||
* If you would like to **add or change some features**, just fork it, hack away, and file a pull request. We'll do our best to merge it quickly. _Prettier_ is enabled, so you don't need to worry about the code style. | ||
@@ -206,37 +209,25 @@ **[⬆ back to top](#)** | ||
[node-img]: https://img.shields.io/node/v/util-array-object-or-both.svg?style=flat-square&label=works%20on%20node | ||
[node-url]: https://www.npmjs.com/package/util-array-object-or-both | ||
[npm-img]: https://img.shields.io/npm/v/util-array-object-or-both.svg?style=flat-square&label=release | ||
[npm-url]: https://www.npmjs.com/package/util-array-object-or-both | ||
[travis-img]: https://img.shields.io/travis/codsen/util-array-object-or-both.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/codsen/util-array-object-or-both | ||
[cov-img]: https://coveralls.io/repos/github/codsen/util-array-object-or-both/badge.svg?style=flat-square?branch=master | ||
[cov-url]: https://coveralls.io/github/codsen/util-array-object-or-both?branch=master | ||
[overall-img]: https://img.shields.io/bithound/code/github/codsen/util-array-object-or-both.svg?style=flat-square | ||
[overall-url]: https://www.bithound.io/github/codsen/util-array-object-or-both | ||
[deps-img]: https://img.shields.io/bithound/dependencies/github/codsen/util-array-object-or-both.svg?style=flat-square | ||
[deps-url]: https://www.bithound.io/github/codsen/util-array-object-or-both/master/dependencies/npm | ||
[deps2d-img]: https://img.shields.io/badge/deps%20in%202D-see_here-08f0fd.svg?style=flat-square | ||
[deps2d-url]: http://npm.anvaka.com/#/view/2d/util-array-object-or-both | ||
[dev-img]: https://img.shields.io/bithound/devDependencies/github/codsen/util-array-object-or-both.svg?style=flat-square | ||
[dev-url]: https://www.bithound.io/github/codsen/util-array-object-or-both/master/dependencies/npm | ||
[vulnerabilities-img]: https://snyk.io/test/github/codsen/util-array-object-or-both/badge.svg?style=flat-square | ||
[vulnerabilities-url]: https://snyk.io/test/github/codsen/util-array-object-or-both | ||
[downloads-img]: https://img.shields.io/npm/dm/util-array-object-or-both.svg?style=flat-square | ||
[downloads-url]: https://npmcharts.com/compare/util-array-object-or-both | ||
[runkit-img]: https://img.shields.io/badge/runkit-test_in_browser-a853ff.svg?style=flat-square | ||
[runkit-url]: https://npm.runkit.com/util-array-object-or-both | ||
[prettier-img]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square | ||
[prettier-url]: https://github.com/prettier/prettier | ||
[license-img]: https://img.shields.io/npm/l/util-array-object-or-both.svg?style=flat-square | ||
[license-url]: https://github.com/codsen/util-array-object-or-both/blob/master/license.md |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
41913
199
18
223
1
+ Addedast-monkey-traverse@4.0.16(transitive)
+ Addedast-monkey-util@3.0.8(transitive)
+ Addedcheck-types-mini@8.0.19(transitive)
+ Addedcodsen-utils@1.6.4(transitive)
+ Addedescape-string-regexp@5.0.0(transitive)
+ Addedmatcher@5.0.0(transitive)
+ Addedobject-path@0.11.8(transitive)
+ Addedrfdc@1.4.1(transitive)
- Removedcheck-types-mini@3.4.4(transitive)
- Removedlodash.intersection@4.4.0(transitive)
- Removedlodash.pullall@4.2.0(transitive)
Updatedcheck-types-mini@latest