object-flatten-all-arrays 6.0.3 → 6.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -20
- package/LICENSE +1 -1
- package/dist/object-flatten-all-arrays.esm.js +49 -48
- package/dist/object-flatten-all-arrays.umd.js +2 -2
- package/package.json +21 -25
package/CHANGELOG.md
CHANGED
|
@@ -3,26 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## 6.0.3 (2021-11-02)
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
- bump TS and separate ESLint plugins away from this monorepo ([b1ebce1](https://github.com/codsen/codsen/commit/b1ebce1637d8c41c2d848fc24b0ba4058865bd5d))
|
|
11
|
-
|
|
12
|
-
### Features
|
|
13
|
-
|
|
14
|
-
- migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
|
|
15
|
-
|
|
16
|
-
### BREAKING CHANGES
|
|
17
|
-
|
|
18
|
-
- programs now are in ES Modules and won't work with Common JS require()
|
|
19
|
-
|
|
20
|
-
## 6.0.1 (2021-09-13)
|
|
21
|
-
|
|
22
|
-
### Bug Fixes
|
|
23
|
-
|
|
24
|
-
- bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
|
|
25
|
-
|
|
26
6
|
## 6.0.0 (2021-09-09)
|
|
27
7
|
|
|
28
8
|
### Features
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010
|
|
3
|
+
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-flatten-all-arrays
|
|
3
3
|
* @fileoverview Merge and flatten any arrays found in all values within plain objects
|
|
4
|
-
* @version 6.0.
|
|
4
|
+
* @version 6.0.7
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-flatten-all-arrays/}
|
|
@@ -11,60 +11,61 @@ import merge from 'lodash.merge';
|
|
|
11
11
|
import clone from 'lodash.clonedeep';
|
|
12
12
|
import isObj from 'lodash.isplainobject';
|
|
13
13
|
|
|
14
|
-
var version$1 = "6.0.
|
|
14
|
+
var version$1 = "6.0.7";
|
|
15
15
|
|
|
16
16
|
const version = version$1;
|
|
17
17
|
function flattenAllArrays(originalIncommingObj, originalOpts) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
const defaults = {
|
|
22
|
-
flattenArraysContainingStringsToBeEmpty: false
|
|
23
|
-
};
|
|
24
|
-
const opts = { ...defaults,
|
|
25
|
-
...originalOpts
|
|
26
|
-
};
|
|
27
|
-
const incommingObj = clone(originalIncommingObj);
|
|
28
|
-
let isFirstObj;
|
|
29
|
-
let combinedObj;
|
|
30
|
-
let firstObjIndex;
|
|
31
|
-
if (Array.isArray(incommingObj)) {
|
|
32
|
-
if (opts.flattenArraysContainingStringsToBeEmpty && arrayContainsStr(incommingObj)) {
|
|
33
|
-
return [];
|
|
18
|
+
function arrayContainsStr(arr) {
|
|
19
|
+
return arr.some((val) => typeof val === "string");
|
|
34
20
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
const defaults = {
|
|
22
|
+
flattenArraysContainingStringsToBeEmpty: false,
|
|
23
|
+
};
|
|
24
|
+
const opts = { ...defaults, ...originalOpts };
|
|
25
|
+
const incommingObj = clone(originalIncommingObj);
|
|
26
|
+
let isFirstObj;
|
|
27
|
+
let combinedObj;
|
|
28
|
+
let firstObjIndex;
|
|
29
|
+
if (Array.isArray(incommingObj)) {
|
|
30
|
+
if (opts.flattenArraysContainingStringsToBeEmpty &&
|
|
31
|
+
arrayContainsStr(incommingObj)) {
|
|
32
|
+
return [];
|
|
47
33
|
}
|
|
48
|
-
|
|
34
|
+
isFirstObj = null;
|
|
35
|
+
combinedObj = {};
|
|
36
|
+
firstObjIndex = 0;
|
|
37
|
+
for (let i = 0, len = incommingObj.length; i < len; i++) {
|
|
38
|
+
if (isObj(incommingObj[i])) {
|
|
39
|
+
combinedObj = merge(combinedObj, incommingObj[i]);
|
|
40
|
+
if (isFirstObj === null) {
|
|
41
|
+
isFirstObj = true;
|
|
42
|
+
firstObjIndex = i;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
incommingObj.splice(i, 1);
|
|
46
|
+
i -= 1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (isFirstObj !== null) {
|
|
51
|
+
incommingObj[firstObjIndex] = clone(combinedObj);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (isObj(incommingObj)) {
|
|
55
|
+
Object.keys(incommingObj).forEach((key) => {
|
|
56
|
+
if (isObj(incommingObj[key]) || Array.isArray(incommingObj[key])) {
|
|
57
|
+
incommingObj[key] = flattenAllArrays(incommingObj[key], opts);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
49
60
|
}
|
|
50
|
-
if (
|
|
51
|
-
|
|
61
|
+
else if (Array.isArray(incommingObj)) {
|
|
62
|
+
incommingObj.forEach((_el, i) => {
|
|
63
|
+
if (isObj(incommingObj[i]) || Array.isArray(incommingObj[i])) {
|
|
64
|
+
incommingObj[i] = flattenAllArrays(incommingObj[i], opts);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
52
67
|
}
|
|
53
|
-
|
|
54
|
-
if (isObj(incommingObj)) {
|
|
55
|
-
Object.keys(incommingObj).forEach(key => {
|
|
56
|
-
if (isObj(incommingObj[key]) || Array.isArray(incommingObj[key])) {
|
|
57
|
-
incommingObj[key] = flattenAllArrays(incommingObj[key], opts);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
} else if (Array.isArray(incommingObj)) {
|
|
61
|
-
incommingObj.forEach((_el, i) => {
|
|
62
|
-
if (isObj(incommingObj[i]) || Array.isArray(incommingObj[i])) {
|
|
63
|
-
incommingObj[i] = flattenAllArrays(incommingObj[i], opts);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return incommingObj;
|
|
68
|
+
return incommingObj;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
export { flattenAllArrays, version };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-flatten-all-arrays
|
|
3
3
|
* @fileoverview Merge and flatten any arrays found in all values within plain objects
|
|
4
|
-
* @version 6.0.
|
|
4
|
+
* @version 6.0.7
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-flatten-all-arrays/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).objectFlattenAllArrays={})}(this,(function(t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Function]",c="[object Object]",a=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[i]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s[u]=s["[object Map]"]=s["[object Number]"]=s[c]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var l="object"==typeof r&&r&&r.Object===Object&&r,p="object"==typeof self&&self&&self.Object===Object&&self,_=l||p||Function("return this")(),y=e&&!e.nodeType&&e,h=y&&t&&!t.nodeType&&t,v=h&&h.exports===y,b=v&&l.process,d=function(){try{var t=h&&h.require&&h.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),g=d&&d.isTypedArray;function j(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var A,O,w,m=Array.prototype,x=Object.prototype,S=_["__core-js_shared__"],z=Function.prototype.toString,E=x.hasOwnProperty,P=(A=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",F=x.toString,$=z.call(Object),T=RegExp("^"+z.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=v?_.Buffer:void 0,U=_.Symbol,B=_.Uint8Array,k=I?I.allocUnsafe:void 0,M=(O=Object.getPrototypeOf,w=Object,function(t){return O(w(t))}),C=Object.create,D=x.propertyIsEnumerable,R=m.splice,L=U?U.toStringTag:void 0,N=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),V=I?I.isBuffer:void 0,W=Math.max,q=Date.now,G=yt(_,"Map"),H=yt(Object,"create"),J=function(){function t(){}return function(r){if(!St(r))return{};if(C)return C(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();function K(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function Q(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function X(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function Y(t){var r=this.__data__=new Q(t);this.size=r.size}function Z(t,r){var e=At(t),n=!e&&jt(t),o=!e&&!n&&wt(t),i=!e&&!n&&!o&&Et(t),u=e||n||o||i,c=u?function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}(t.length,String):[],a=c.length;for(var f in t)!r&&!E.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||ht(f,a))||c.push(f);return c}function tt(t,r,e){(void 0!==e&&!gt(t[r],e)||void 0===e&&!(r in t))&&nt(t,r,e)}function rt(t,r,e){var n=t[r];E.call(t,r)&>(n,e)&&(void 0!==e||r in t)||nt(t,r,e)}function et(t,r){for(var e=t.length;e--;)if(gt(t[e][0],r))return e;return-1}function nt(t,r,e){"__proto__"==r&&N?N(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}K.prototype.clear=function(){this.__data__=H?H(null):{},this.size=0},K.prototype.delete=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},K.prototype.get=function(t){var r=this.__data__;if(H){var e=r[t];return e===n?void 0:e}return E.call(r,t)?r[t]:void 0},K.prototype.has=function(t){var r=this.__data__;return H?void 0!==r[t]:E.call(r,t)},K.prototype.set=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=H&&void 0===r?n:r,this},Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(t){var r=this.__data__,e=et(r,t);return!(e<0)&&(e==r.length-1?r.pop():R.call(r,e,1),--this.size,!0)},Q.prototype.get=function(t){var r=this.__data__,e=et(r,t);return e<0?void 0:r[e][1]},Q.prototype.has=function(t){return et(this.__data__,t)>-1},Q.prototype.set=function(t,r){var e=this.__data__,n=et(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(G||Q),string:new K}},X.prototype.delete=function(t){var r=_t(this,t).delete(t);return this.size-=r?1:0,r},X.prototype.get=function(t){return _t(this,t).get(t)},X.prototype.has=function(t){return _t(this,t).has(t)},X.prototype.set=function(t,r){var e=_t(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this},Y.prototype.clear=function(){this.__data__=new Q,this.size=0},Y.prototype.delete=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e},Y.prototype.get=function(t){return this.__data__.get(t)},Y.prototype.has=function(t){return this.__data__.has(t)},Y.prototype.set=function(t,r){var e=this.__data__;if(e instanceof Q){var n=e.__data__;if(!G||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new X(n)}return e.set(t,r),this.size=e.size,this};var ot,it=function(t,r,e){for(var n=-1,o=Object(t),i=e(t),u=i.length;u--;){var c=i[ot?u:++n];if(!1===r(o[c],c,o))break}return t};function ut(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":L&&L in Object(t)?function(t){var r=E.call(t,L),e=t[L];try{t[L]=void 0;var n=!0}catch(t){}var o=F.call(t);n&&(r?t[L]=e:delete t[L]);return o}(t):function(t){return F.call(t)}(t)}function ct(t){return zt(t)&&ut(t)==i}function at(t){return!(!St(t)||function(t){return!!P&&P in t}(t))&&(mt(t)?T:a).test(function(t){if(null!=t){try{return z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ft(t){if(!St(t))return function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r}(t);var r=vt(t),e=[];for(var n in t)("constructor"!=n||!r&&E.call(t,n))&&e.push(n);return e}function st(t,r,e,n,o){t!==r&&it(r,(function(i,u){if(o||(o=new Y),St(i))!function(t,r,e,n,o,i,u){var a=bt(t,e),f=bt(r,e),s=u.get(f);if(s)return void tt(t,e,s);var l=i?i(a,f,e+"",t,r,u):void 0,p=void 0===l;if(p){var _=At(f),y=!_&&wt(f),h=!_&&!y&&Et(f);l=f,_||y||h?At(a)?l=a:zt(j=a)&&Ot(j)?l=function(t,r){var e=-1,n=t.length;r||(r=Array(n));for(;++e<n;)r[e]=t[e];return r}(a):y?(p=!1,l=function(t,r){if(r)return t.slice();var e=t.length,n=k?k(e):new t.constructor(e);return t.copy(n),n}(f,!0)):h?(p=!1,v=f,b=!0?(g=new(d=v.buffer).constructor(d.byteLength),new B(g).set(new B(d)),g):v.buffer,l=new v.constructor(b,v.byteOffset,v.length)):l=[]:function(t){if(!zt(t)||ut(t)!=c)return!1;var r=M(t);if(null===r)return!0;var e=E.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&z.call(e)==$}(f)||jt(f)?(l=a,jt(a)?l=function(t){return function(t,r,e,n){var o=!e;e||(e={});var i=-1,u=r.length;for(;++i<u;){var c=r[i],a=n?n(e[c],t[c],c,e,t):void 0;void 0===a&&(a=t[c]),o?nt(e,c,a):rt(e,c,a)}return e}(t,Pt(t))}(a):St(a)&&!mt(a)||(l=function(t){return"function"!=typeof t.constructor||vt(t)?{}:J(M(t))}(f))):p=!1}var v,b,d,g;var j;p&&(u.set(f,l),o(l,f,n,i,u),u.delete(f));tt(t,e,l)}(t,r,u,e,st,n,o);else{var a=n?n(bt(t,u),i,u+"",t,r,o):void 0;void 0===a&&(a=i),tt(t,u,a)}}),Pt)}function lt(t,r){return dt(function(t,r,e){return r=W(void 0===r?t.length-1:r,0),function(){for(var n=arguments,o=-1,i=W(n.length-r,0),u=Array(i);++o<i;)u[o]=n[r+o];o=-1;for(var c=Array(r+1);++o<r;)c[o]=n[o];return c[r]=e(u),j(t,this,c)}}(t,r,Tt),t+"")}var pt=N?function(t,r){return N(t,"toString",{configurable:!0,enumerable:!1,value:(e=r,function(){return e}),writable:!0});var e}:Tt;function _t(t,r){var e,n,o=t.__data__;return("string"==(n=typeof(e=r))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e)?o["string"==typeof r?"string":"hash"]:o.map}function yt(t,r){var e=function(t,r){return null==t?void 0:t[r]}(t,r);return at(e)?e:void 0}function ht(t,r){var e=typeof t;return!!(r=null==r?o:r)&&("number"==e||"symbol"!=e&&f.test(t))&&t>-1&&t%1==0&&t<r}function vt(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||x)}function bt(t,r){if(("constructor"!==r||"function"!=typeof t[r])&&"__proto__"!=r)return t[r]}var dt=function(t){var r=0,e=0;return function(){var n=q(),o=16-(n-e);if(e=n,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}(pt);function gt(t,r){return t===r||t!=t&&r!=r}var jt=ct(function(){return arguments}())?ct:function(t){return zt(t)&&E.call(t,"callee")&&!D.call(t,"callee")},At=Array.isArray;function Ot(t){return null!=t&&xt(t.length)&&!mt(t)}var wt=V||function(){return!1};function mt(t){if(!St(t))return!1;var r=ut(t);return r==u||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}function xt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function St(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}function zt(t){return null!=t&&"object"==typeof t}var Et=g?function(t){return function(r){return t(r)}}(g):function(t){return zt(t)&&xt(t.length)&&!!s[ut(t)]};function Pt(t){return Ot(t)?Z(t,!0):ft(t)}var Ft,$t=(Ft=function(t,r,e){st(t,r,e)},lt((function(t,r){var e=-1,n=r.length,o=n>1?r[n-1]:void 0,i=n>2?r[2]:void 0;for(o=Ft.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,r,e){if(!St(e))return!1;var n=typeof r;return!!("number"==n?Ot(e)&&ht(r,e.length):"string"==n&&r in e)&>(e[r],t)}(r[0],r[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++e<n;){var u=r[e];u&&Ft(t,u,e,o)}return t})));function Tt(t){return t}t.exports=$t}(e,e.exports);var n=e.exports,o={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Boolean]",c="[object Date]",a="[object Function]",f="[object GeneratorFunction]",s="[object Map]",l="[object Number]",p="[object Object]",_="[object Promise]",y="[object RegExp]",h="[object Set]",v="[object String]",b="[object Symbol]",d="[object WeakMap]",g="[object ArrayBuffer]",j="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",w="[object Int8Array]",m="[object Int16Array]",x="[object Int32Array]",S="[object Uint8Array]",z="[object Uint8ClampedArray]",E="[object Uint16Array]",P="[object Uint32Array]",F=/\w*$/,$=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,I={};I[i]=I["[object Array]"]=I[g]=I[j]=I[u]=I[c]=I[A]=I[O]=I[w]=I[m]=I[x]=I[s]=I[l]=I[p]=I[y]=I[h]=I[v]=I[b]=I[S]=I[z]=I[E]=I[P]=!0,I["[object Error]"]=I[a]=I[d]=!1;var U="object"==typeof self&&self&&self.Object===Object&&self,B="object"==typeof r&&r&&r.Object===Object&&r||U||Function("return this")(),k=e&&!e.nodeType&&e,M=k&&t&&!t.nodeType&&t,C=M&&M.exports===k;function D(t,r){return t.set(r[0],r[1]),t}function R(t,r){return t.add(r),t}function L(t,r,e,n){var o=-1,i=t?t.length:0;for(n&&i&&(e=t[++o]);++o<i;)e=r(e,t[o],o,t);return e}function N(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(t){}return r}function V(t){var r=-1,e=Array(t.size);return t.forEach((function(t,n){e[++r]=[n,t]})),e}function W(t,r){return function(e){return t(r(e))}}function q(t){var r=-1,e=Array(t.size);return t.forEach((function(t){e[++r]=t})),e}var G,H=Array.prototype,J=Function.prototype,K=Object.prototype,Q=B["__core-js_shared__"],X=(G=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",Y=J.toString,Z=K.hasOwnProperty,tt=K.toString,rt=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=C?B.Buffer:void 0,nt=B.Symbol,ot=B.Uint8Array,it=W(Object.getPrototypeOf,Object),ut=Object.create,ct=K.propertyIsEnumerable,at=H.splice,ft=Object.getOwnPropertySymbols,st=et?et.isBuffer:void 0,lt=W(Object.keys,Object),pt=Mt(B,"DataView"),_t=Mt(B,"Map"),yt=Mt(B,"Promise"),ht=Mt(B,"Set"),vt=Mt(B,"WeakMap"),bt=Mt(Object,"create"),dt=Nt(pt),gt=Nt(_t),jt=Nt(yt),At=Nt(ht),Ot=Nt(vt),wt=nt?nt.prototype:void 0,mt=wt?wt.valueOf:void 0;function xt(t){var r=-1,e=t?t.length:0;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function St(t){var r=-1,e=t?t.length:0;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function zt(t){var r=-1,e=t?t.length:0;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function Et(t){this.__data__=new St(t)}function Pt(t,r){var e=Wt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&qt(t)}(t)&&Z.call(t,"callee")&&(!ct.call(t,"callee")||tt.call(t)==i)}(t)?function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}(t.length,String):[],n=e.length,o=!!n;for(var u in t)!r&&!Z.call(t,u)||o&&("length"==u||Rt(u,n))||e.push(u);return e}function Ft(t,r,e){var n=t[r];Z.call(t,r)&&Vt(n,e)&&(void 0!==e||r in t)||(t[r]=e)}function $t(t,r){for(var e=t.length;e--;)if(Vt(t[e][0],r))return e;return-1}function Tt(t,r,e,n,o,_,d){var $;if(n&&($=_?n(t,o,_,d):n(t)),void 0!==$)return $;if(!Jt(t))return t;var T=Wt(t);if(T){if($=function(t){var r=t.length,e=t.constructor(r);r&&"string"==typeof t[0]&&Z.call(t,"index")&&(e.index=t.index,e.input=t.input);return e}(t),!r)return function(t,r){var e=-1,n=t.length;r||(r=Array(n));for(;++e<n;)r[e]=t[e];return r}(t,$)}else{var U=Dt(t),B=U==a||U==f;if(Gt(t))return function(t,r){if(r)return t.slice();var e=new t.constructor(t.length);return t.copy(e),e}(t,r);if(U==p||U==i||B&&!_){if(N(t))return _?t:{};if($=function(t){return"function"!=typeof t.constructor||Lt(t)?{}:(r=it(t),Jt(r)?ut(r):{});var r}(B?{}:t),!r)return function(t,r){return Bt(t,Ct(t),r)}(t,function(t,r){return t&&Bt(r,Kt(r),t)}($,t))}else{if(!I[U])return _?t:{};$=function(t,r,e,n){var o=t.constructor;switch(r){case g:return Ut(t);case u:case c:return new o(+t);case j:return function(t,r){var e=r?Ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,n);case A:case O:case w:case m:case x:case S:case z:case E:case P:return function(t,r){var e=r?Ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}(t,n);case s:return function(t,r,e){return L(r?e(V(t),!0):V(t),D,new t.constructor)}(t,n,e);case l:case v:return new o(t);case y:return function(t){var r=new t.constructor(t.source,F.exec(t));return r.lastIndex=t.lastIndex,r}(t);case h:return function(t,r,e){return L(r?e(q(t),!0):q(t),R,new t.constructor)}(t,n,e);case b:return i=t,mt?Object(mt.call(i)):{}}var i}(t,U,Tt,r)}}d||(d=new Et);var k=d.get(t);if(k)return k;if(d.set(t,$),!T)var M=e?function(t){return function(t,r,e){var n=r(t);return Wt(t)?n:function(t,r){for(var e=-1,n=r.length,o=t.length;++e<n;)t[o+e]=r[e];return t}(n,e(t))}(t,Kt,Ct)}(t):Kt(t);return function(t,r){for(var e=-1,n=t?t.length:0;++e<n&&!1!==r(t[e],e,t););}(M||t,(function(o,i){M&&(o=t[i=o]),Ft($,i,Tt(o,r,e,n,i,t,d))})),$}function It(t){return!(!Jt(t)||(r=t,X&&X in r))&&(Ht(t)||N(t)?rt:$).test(Nt(t));var r}function Ut(t){var r=new t.constructor(t.byteLength);return new ot(r).set(new ot(t)),r}function Bt(t,r,e,n){e||(e={});for(var o=-1,i=r.length;++o<i;){var u=r[o],c=n?n(e[u],t[u],u,e,t):void 0;Ft(e,u,void 0===c?t[u]:c)}return e}function kt(t,r){var e,n,o=t.__data__;return("string"==(n=typeof(e=r))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e)?o["string"==typeof r?"string":"hash"]:o.map}function Mt(t,r){var e=function(t,r){return null==t?void 0:t[r]}(t,r);return It(e)?e:void 0}xt.prototype.clear=function(){this.__data__=bt?bt(null):{}},xt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},xt.prototype.get=function(t){var r=this.__data__;if(bt){var e=r[t];return e===n?void 0:e}return Z.call(r,t)?r[t]:void 0},xt.prototype.has=function(t){var r=this.__data__;return bt?void 0!==r[t]:Z.call(r,t)},xt.prototype.set=function(t,r){return this.__data__[t]=bt&&void 0===r?n:r,this},St.prototype.clear=function(){this.__data__=[]},St.prototype.delete=function(t){var r=this.__data__,e=$t(r,t);return!(e<0)&&(e==r.length-1?r.pop():at.call(r,e,1),!0)},St.prototype.get=function(t){var r=this.__data__,e=$t(r,t);return e<0?void 0:r[e][1]},St.prototype.has=function(t){return $t(this.__data__,t)>-1},St.prototype.set=function(t,r){var e=this.__data__,n=$t(e,t);return n<0?e.push([t,r]):e[n][1]=r,this},zt.prototype.clear=function(){this.__data__={hash:new xt,map:new(_t||St),string:new xt}},zt.prototype.delete=function(t){return kt(this,t).delete(t)},zt.prototype.get=function(t){return kt(this,t).get(t)},zt.prototype.has=function(t){return kt(this,t).has(t)},zt.prototype.set=function(t,r){return kt(this,t).set(t,r),this},Et.prototype.clear=function(){this.__data__=new St},Et.prototype.delete=function(t){return this.__data__.delete(t)},Et.prototype.get=function(t){return this.__data__.get(t)},Et.prototype.has=function(t){return this.__data__.has(t)},Et.prototype.set=function(t,r){var e=this.__data__;if(e instanceof St){var n=e.__data__;if(!_t||n.length<199)return n.push([t,r]),this;e=this.__data__=new zt(n)}return e.set(t,r),this};var Ct=ft?W(ft,Object):function(){return[]},Dt=function(t){return tt.call(t)};function Rt(t,r){return!!(r=null==r?o:r)&&("number"==typeof t||T.test(t))&&t>-1&&t%1==0&&t<r}function Lt(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||K)}function Nt(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Vt(t,r){return t===r||t!=t&&r!=r}(pt&&Dt(new pt(new ArrayBuffer(1)))!=j||_t&&Dt(new _t)!=s||yt&&Dt(yt.resolve())!=_||ht&&Dt(new ht)!=h||vt&&Dt(new vt)!=d)&&(Dt=function(t){var r=tt.call(t),e=r==p?t.constructor:void 0,n=e?Nt(e):void 0;if(n)switch(n){case dt:return j;case gt:return s;case jt:return _;case At:return h;case Ot:return d}return r});var Wt=Array.isArray;function qt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}(t.length)&&!Ht(t)}var Gt=st||function(){return!1};function Ht(t){var r=Jt(t)?tt.call(t):"";return r==a||r==f}function Jt(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function Kt(t){return qt(t)?Pt(t):function(t){if(!Lt(t))return lt(t);var r=[];for(var e in Object(t))Z.call(t,e)&&"constructor"!=e&&r.push(e);return r}(t)}t.exports=function(t){return Tt(t,!0,!0)}}(o,o.exports);var i=o.exports;var u,c,a=Object.prototype,f=Function.prototype.toString,s=a.hasOwnProperty,l=f.call(Object),p=a.toString,_=(u=Object.getPrototypeOf,c=Object,function(t){return u(c(t))});var y=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=p.call(t)||function(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(t){}return r}(t))return!1;var r=_(t);if(null===r)return!0;var e=s.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&f.call(e)==l};t.flattenAllArrays=function t(r,e){const o={flattenArraysContainingStringsToBeEmpty:!1,...e},u=i(r);let c,a,f;if(Array.isArray(u)){if(o.flattenArraysContainingStringsToBeEmpty&&u.some((t=>"string"==typeof t)))return[];c=null,a={},f=0;for(let t=0,r=u.length;t<r;t++)y(u[t])&&(a=n(a,u[t]),null===c?(c=!0,f=t):(u.splice(t,1),t-=1));null!==c&&(u[f]=i(a))}return y(u)?Object.keys(u).forEach((r=>{(y(u[r])||Array.isArray(u[r]))&&(u[r]=t(u[r],o))})):Array.isArray(u)&&u.forEach(((r,e)=>{(y(u[e])||Array.isArray(u[e]))&&(u[e]=t(u[e],o))})),u},t.version="6.0.3",Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
10
|
+
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).objectFlattenAllArrays={})}(this,(function(t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Function]",c="[object Object]",a=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[i]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s[u]=s["[object Map]"]=s["[object Number]"]=s[c]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var l="object"==typeof r&&r&&r.Object===Object&&r,p="object"==typeof self&&self&&self.Object===Object&&self,_=l||p||Function("return this")(),y=e&&!e.nodeType&&e,h=y&&t&&!t.nodeType&&t,v=h&&h.exports===y,b=v&&l.process,d=function(){try{var t=h&&h.require&&h.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),g=d&&d.isTypedArray;function j(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var A,O,w,m=Array.prototype,x=Object.prototype,S=_["__core-js_shared__"],z=Function.prototype.toString,E=x.hasOwnProperty,P=(A=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",F=x.toString,$=z.call(Object),T=RegExp("^"+z.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=v?_.Buffer:void 0,U=_.Symbol,B=_.Uint8Array,k=I?I.allocUnsafe:void 0,M=(O=Object.getPrototypeOf,w=Object,function(t){return O(w(t))}),C=Object.create,D=x.propertyIsEnumerable,R=m.splice,L=U?U.toStringTag:void 0,N=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),V=I?I.isBuffer:void 0,W=Math.max,q=Date.now,G=yt(_,"Map"),H=yt(Object,"create"),J=function(){function t(){}return function(r){if(!St(r))return{};if(C)return C(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();function K(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function Q(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function X(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function Y(t){var r=this.__data__=new Q(t);this.size=r.size}function Z(t,r){var e=At(t),n=!e&&jt(t),o=!e&&!n&&wt(t),i=!e&&!n&&!o&&Et(t),u=e||n||o||i,c=u?function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}(t.length,String):[],a=c.length;for(var f in t)!r&&!E.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||ht(f,a))||c.push(f);return c}function tt(t,r,e){(void 0!==e&&!gt(t[r],e)||void 0===e&&!(r in t))&&nt(t,r,e)}function rt(t,r,e){var n=t[r];E.call(t,r)&>(n,e)&&(void 0!==e||r in t)||nt(t,r,e)}function et(t,r){for(var e=t.length;e--;)if(gt(t[e][0],r))return e;return-1}function nt(t,r,e){"__proto__"==r&&N?N(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}K.prototype.clear=function(){this.__data__=H?H(null):{},this.size=0},K.prototype.delete=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},K.prototype.get=function(t){var r=this.__data__;if(H){var e=r[t];return e===n?void 0:e}return E.call(r,t)?r[t]:void 0},K.prototype.has=function(t){var r=this.__data__;return H?void 0!==r[t]:E.call(r,t)},K.prototype.set=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=H&&void 0===r?n:r,this},Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(t){var r=this.__data__,e=et(r,t);return!(e<0)&&(e==r.length-1?r.pop():R.call(r,e,1),--this.size,!0)},Q.prototype.get=function(t){var r=this.__data__,e=et(r,t);return e<0?void 0:r[e][1]},Q.prototype.has=function(t){return et(this.__data__,t)>-1},Q.prototype.set=function(t,r){var e=this.__data__,n=et(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(G||Q),string:new K}},X.prototype.delete=function(t){var r=_t(this,t).delete(t);return this.size-=r?1:0,r},X.prototype.get=function(t){return _t(this,t).get(t)},X.prototype.has=function(t){return _t(this,t).has(t)},X.prototype.set=function(t,r){var e=_t(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this},Y.prototype.clear=function(){this.__data__=new Q,this.size=0},Y.prototype.delete=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e},Y.prototype.get=function(t){return this.__data__.get(t)},Y.prototype.has=function(t){return this.__data__.has(t)},Y.prototype.set=function(t,r){var e=this.__data__;if(e instanceof Q){var n=e.__data__;if(!G||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new X(n)}return e.set(t,r),this.size=e.size,this};var ot,it=function(t,r,e){for(var n=-1,o=Object(t),i=e(t),u=i.length;u--;){var c=i[ot?u:++n];if(!1===r(o[c],c,o))break}return t};function ut(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":L&&L in Object(t)?function(t){var r=E.call(t,L),e=t[L];try{t[L]=void 0;var n=!0}catch(t){}var o=F.call(t);n&&(r?t[L]=e:delete t[L]);return o}(t):function(t){return F.call(t)}(t)}function ct(t){return zt(t)&&ut(t)==i}function at(t){return!(!St(t)||function(t){return!!P&&P in t}(t))&&(mt(t)?T:a).test(function(t){if(null!=t){try{return z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ft(t){if(!St(t))return function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r}(t);var r=vt(t),e=[];for(var n in t)("constructor"!=n||!r&&E.call(t,n))&&e.push(n);return e}function st(t,r,e,n,o){t!==r&&it(r,(function(i,u){if(o||(o=new Y),St(i))!function(t,r,e,n,o,i,u){var a=bt(t,e),f=bt(r,e),s=u.get(f);if(s)return void tt(t,e,s);var l=i?i(a,f,e+"",t,r,u):void 0,p=void 0===l;if(p){var _=At(f),y=!_&&wt(f),h=!_&&!y&&Et(f);l=f,_||y||h?At(a)?l=a:zt(j=a)&&Ot(j)?l=function(t,r){var e=-1,n=t.length;r||(r=Array(n));for(;++e<n;)r[e]=t[e];return r}(a):y?(p=!1,l=function(t,r){if(r)return t.slice();var e=t.length,n=k?k(e):new t.constructor(e);return t.copy(n),n}(f,!0)):h?(p=!1,v=f,b=!0?(g=new(d=v.buffer).constructor(d.byteLength),new B(g).set(new B(d)),g):v.buffer,l=new v.constructor(b,v.byteOffset,v.length)):l=[]:function(t){if(!zt(t)||ut(t)!=c)return!1;var r=M(t);if(null===r)return!0;var e=E.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&z.call(e)==$}(f)||jt(f)?(l=a,jt(a)?l=function(t){return function(t,r,e,n){var o=!e;e||(e={});var i=-1,u=r.length;for(;++i<u;){var c=r[i],a=n?n(e[c],t[c],c,e,t):void 0;void 0===a&&(a=t[c]),o?nt(e,c,a):rt(e,c,a)}return e}(t,Pt(t))}(a):St(a)&&!mt(a)||(l=function(t){return"function"!=typeof t.constructor||vt(t)?{}:J(M(t))}(f))):p=!1}var v,b,d,g;var j;p&&(u.set(f,l),o(l,f,n,i,u),u.delete(f));tt(t,e,l)}(t,r,u,e,st,n,o);else{var a=n?n(bt(t,u),i,u+"",t,r,o):void 0;void 0===a&&(a=i),tt(t,u,a)}}),Pt)}function lt(t,r){return dt(function(t,r,e){return r=W(void 0===r?t.length-1:r,0),function(){for(var n=arguments,o=-1,i=W(n.length-r,0),u=Array(i);++o<i;)u[o]=n[r+o];o=-1;for(var c=Array(r+1);++o<r;)c[o]=n[o];return c[r]=e(u),j(t,this,c)}}(t,r,Tt),t+"")}var pt=N?function(t,r){return N(t,"toString",{configurable:!0,enumerable:!1,value:(e=r,function(){return e}),writable:!0});var e}:Tt;function _t(t,r){var e,n,o=t.__data__;return("string"==(n=typeof(e=r))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e)?o["string"==typeof r?"string":"hash"]:o.map}function yt(t,r){var e=function(t,r){return null==t?void 0:t[r]}(t,r);return at(e)?e:void 0}function ht(t,r){var e=typeof t;return!!(r=null==r?o:r)&&("number"==e||"symbol"!=e&&f.test(t))&&t>-1&&t%1==0&&t<r}function vt(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||x)}function bt(t,r){if(("constructor"!==r||"function"!=typeof t[r])&&"__proto__"!=r)return t[r]}var dt=function(t){var r=0,e=0;return function(){var n=q(),o=16-(n-e);if(e=n,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}(pt);function gt(t,r){return t===r||t!=t&&r!=r}var jt=ct(function(){return arguments}())?ct:function(t){return zt(t)&&E.call(t,"callee")&&!D.call(t,"callee")},At=Array.isArray;function Ot(t){return null!=t&&xt(t.length)&&!mt(t)}var wt=V||function(){return!1};function mt(t){if(!St(t))return!1;var r=ut(t);return r==u||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}function xt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function St(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}function zt(t){return null!=t&&"object"==typeof t}var Et=g?function(t){return function(r){return t(r)}}(g):function(t){return zt(t)&&xt(t.length)&&!!s[ut(t)]};function Pt(t){return Ot(t)?Z(t,!0):ft(t)}var Ft,$t=(Ft=function(t,r,e){st(t,r,e)},lt((function(t,r){var e=-1,n=r.length,o=n>1?r[n-1]:void 0,i=n>2?r[2]:void 0;for(o=Ft.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,r,e){if(!St(e))return!1;var n=typeof r;return!!("number"==n?Ot(e)&&ht(r,e.length):"string"==n&&r in e)&>(e[r],t)}(r[0],r[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++e<n;){var u=r[e];u&&Ft(t,u,e,o)}return t})));function Tt(t){return t}t.exports=$t}(e,e.exports);var n=e.exports,o={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Boolean]",c="[object Date]",a="[object Function]",f="[object GeneratorFunction]",s="[object Map]",l="[object Number]",p="[object Object]",_="[object Promise]",y="[object RegExp]",h="[object Set]",v="[object String]",b="[object Symbol]",d="[object WeakMap]",g="[object ArrayBuffer]",j="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",w="[object Int8Array]",m="[object Int16Array]",x="[object Int32Array]",S="[object Uint8Array]",z="[object Uint8ClampedArray]",E="[object Uint16Array]",P="[object Uint32Array]",F=/\w*$/,$=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,I={};I[i]=I["[object Array]"]=I[g]=I[j]=I[u]=I[c]=I[A]=I[O]=I[w]=I[m]=I[x]=I[s]=I[l]=I[p]=I[y]=I[h]=I[v]=I[b]=I[S]=I[z]=I[E]=I[P]=!0,I["[object Error]"]=I[a]=I[d]=!1;var U="object"==typeof self&&self&&self.Object===Object&&self,B="object"==typeof r&&r&&r.Object===Object&&r||U||Function("return this")(),k=e&&!e.nodeType&&e,M=k&&t&&!t.nodeType&&t,C=M&&M.exports===k;function D(t,r){return t.set(r[0],r[1]),t}function R(t,r){return t.add(r),t}function L(t,r,e,n){var o=-1,i=t?t.length:0;for(n&&i&&(e=t[++o]);++o<i;)e=r(e,t[o],o,t);return e}function N(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(t){}return r}function V(t){var r=-1,e=Array(t.size);return t.forEach((function(t,n){e[++r]=[n,t]})),e}function W(t,r){return function(e){return t(r(e))}}function q(t){var r=-1,e=Array(t.size);return t.forEach((function(t){e[++r]=t})),e}var G,H=Array.prototype,J=Function.prototype,K=Object.prototype,Q=B["__core-js_shared__"],X=(G=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",Y=J.toString,Z=K.hasOwnProperty,tt=K.toString,rt=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=C?B.Buffer:void 0,nt=B.Symbol,ot=B.Uint8Array,it=W(Object.getPrototypeOf,Object),ut=Object.create,ct=K.propertyIsEnumerable,at=H.splice,ft=Object.getOwnPropertySymbols,st=et?et.isBuffer:void 0,lt=W(Object.keys,Object),pt=Mt(B,"DataView"),_t=Mt(B,"Map"),yt=Mt(B,"Promise"),ht=Mt(B,"Set"),vt=Mt(B,"WeakMap"),bt=Mt(Object,"create"),dt=Nt(pt),gt=Nt(_t),jt=Nt(yt),At=Nt(ht),Ot=Nt(vt),wt=nt?nt.prototype:void 0,mt=wt?wt.valueOf:void 0;function xt(t){var r=-1,e=t?t.length:0;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function St(t){var r=-1,e=t?t.length:0;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function zt(t){var r=-1,e=t?t.length:0;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}function Et(t){this.__data__=new St(t)}function Pt(t,r){var e=Wt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&qt(t)}(t)&&Z.call(t,"callee")&&(!ct.call(t,"callee")||tt.call(t)==i)}(t)?function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}(t.length,String):[],n=e.length,o=!!n;for(var u in t)!r&&!Z.call(t,u)||o&&("length"==u||Rt(u,n))||e.push(u);return e}function Ft(t,r,e){var n=t[r];Z.call(t,r)&&Vt(n,e)&&(void 0!==e||r in t)||(t[r]=e)}function $t(t,r){for(var e=t.length;e--;)if(Vt(t[e][0],r))return e;return-1}function Tt(t,r,e,n,o,_,d){var $;if(n&&($=_?n(t,o,_,d):n(t)),void 0!==$)return $;if(!Jt(t))return t;var T=Wt(t);if(T){if($=function(t){var r=t.length,e=t.constructor(r);r&&"string"==typeof t[0]&&Z.call(t,"index")&&(e.index=t.index,e.input=t.input);return e}(t),!r)return function(t,r){var e=-1,n=t.length;r||(r=Array(n));for(;++e<n;)r[e]=t[e];return r}(t,$)}else{var U=Dt(t),B=U==a||U==f;if(Gt(t))return function(t,r){if(r)return t.slice();var e=new t.constructor(t.length);return t.copy(e),e}(t,r);if(U==p||U==i||B&&!_){if(N(t))return _?t:{};if($=function(t){return"function"!=typeof t.constructor||Lt(t)?{}:(r=it(t),Jt(r)?ut(r):{});var r}(B?{}:t),!r)return function(t,r){return Bt(t,Ct(t),r)}(t,function(t,r){return t&&Bt(r,Kt(r),t)}($,t))}else{if(!I[U])return _?t:{};$=function(t,r,e,n){var o=t.constructor;switch(r){case g:return Ut(t);case u:case c:return new o(+t);case j:return function(t,r){var e=r?Ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,n);case A:case O:case w:case m:case x:case S:case z:case E:case P:return function(t,r){var e=r?Ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}(t,n);case s:return function(t,r,e){return L(r?e(V(t),!0):V(t),D,new t.constructor)}(t,n,e);case l:case v:return new o(t);case y:return function(t){var r=new t.constructor(t.source,F.exec(t));return r.lastIndex=t.lastIndex,r}(t);case h:return function(t,r,e){return L(r?e(q(t),!0):q(t),R,new t.constructor)}(t,n,e);case b:return i=t,mt?Object(mt.call(i)):{}}var i}(t,U,Tt,r)}}d||(d=new Et);var k=d.get(t);if(k)return k;if(d.set(t,$),!T)var M=e?function(t){return function(t,r,e){var n=r(t);return Wt(t)?n:function(t,r){for(var e=-1,n=r.length,o=t.length;++e<n;)t[o+e]=r[e];return t}(n,e(t))}(t,Kt,Ct)}(t):Kt(t);return function(t,r){for(var e=-1,n=t?t.length:0;++e<n&&!1!==r(t[e],e,t););}(M||t,(function(o,i){M&&(o=t[i=o]),Ft($,i,Tt(o,r,e,n,i,t,d))})),$}function It(t){return!(!Jt(t)||(r=t,X&&X in r))&&(Ht(t)||N(t)?rt:$).test(Nt(t));var r}function Ut(t){var r=new t.constructor(t.byteLength);return new ot(r).set(new ot(t)),r}function Bt(t,r,e,n){e||(e={});for(var o=-1,i=r.length;++o<i;){var u=r[o],c=n?n(e[u],t[u],u,e,t):void 0;Ft(e,u,void 0===c?t[u]:c)}return e}function kt(t,r){var e,n,o=t.__data__;return("string"==(n=typeof(e=r))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e)?o["string"==typeof r?"string":"hash"]:o.map}function Mt(t,r){var e=function(t,r){return null==t?void 0:t[r]}(t,r);return It(e)?e:void 0}xt.prototype.clear=function(){this.__data__=bt?bt(null):{}},xt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},xt.prototype.get=function(t){var r=this.__data__;if(bt){var e=r[t];return e===n?void 0:e}return Z.call(r,t)?r[t]:void 0},xt.prototype.has=function(t){var r=this.__data__;return bt?void 0!==r[t]:Z.call(r,t)},xt.prototype.set=function(t,r){return this.__data__[t]=bt&&void 0===r?n:r,this},St.prototype.clear=function(){this.__data__=[]},St.prototype.delete=function(t){var r=this.__data__,e=$t(r,t);return!(e<0)&&(e==r.length-1?r.pop():at.call(r,e,1),!0)},St.prototype.get=function(t){var r=this.__data__,e=$t(r,t);return e<0?void 0:r[e][1]},St.prototype.has=function(t){return $t(this.__data__,t)>-1},St.prototype.set=function(t,r){var e=this.__data__,n=$t(e,t);return n<0?e.push([t,r]):e[n][1]=r,this},zt.prototype.clear=function(){this.__data__={hash:new xt,map:new(_t||St),string:new xt}},zt.prototype.delete=function(t){return kt(this,t).delete(t)},zt.prototype.get=function(t){return kt(this,t).get(t)},zt.prototype.has=function(t){return kt(this,t).has(t)},zt.prototype.set=function(t,r){return kt(this,t).set(t,r),this},Et.prototype.clear=function(){this.__data__=new St},Et.prototype.delete=function(t){return this.__data__.delete(t)},Et.prototype.get=function(t){return this.__data__.get(t)},Et.prototype.has=function(t){return this.__data__.has(t)},Et.prototype.set=function(t,r){var e=this.__data__;if(e instanceof St){var n=e.__data__;if(!_t||n.length<199)return n.push([t,r]),this;e=this.__data__=new zt(n)}return e.set(t,r),this};var Ct=ft?W(ft,Object):function(){return[]},Dt=function(t){return tt.call(t)};function Rt(t,r){return!!(r=null==r?o:r)&&("number"==typeof t||T.test(t))&&t>-1&&t%1==0&&t<r}function Lt(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||K)}function Nt(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Vt(t,r){return t===r||t!=t&&r!=r}(pt&&Dt(new pt(new ArrayBuffer(1)))!=j||_t&&Dt(new _t)!=s||yt&&Dt(yt.resolve())!=_||ht&&Dt(new ht)!=h||vt&&Dt(new vt)!=d)&&(Dt=function(t){var r=tt.call(t),e=r==p?t.constructor:void 0,n=e?Nt(e):void 0;if(n)switch(n){case dt:return j;case gt:return s;case jt:return _;case At:return h;case Ot:return d}return r});var Wt=Array.isArray;function qt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}(t.length)&&!Ht(t)}var Gt=st||function(){return!1};function Ht(t){var r=Jt(t)?tt.call(t):"";return r==a||r==f}function Jt(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function Kt(t){return qt(t)?Pt(t):function(t){if(!Lt(t))return lt(t);var r=[];for(var e in Object(t))Z.call(t,e)&&"constructor"!=e&&r.push(e);return r}(t)}t.exports=function(t){return Tt(t,!0,!0)}}(o,o.exports);var i=o.exports;var u,c,a=Object.prototype,f=Function.prototype.toString,s=a.hasOwnProperty,l=f.call(Object),p=a.toString,_=(u=Object.getPrototypeOf,c=Object,function(t){return u(c(t))});var y=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=p.call(t)||function(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(t){}return r}(t))return!1;var r=_(t);if(null===r)return!0;var e=s.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&f.call(e)==l};t.flattenAllArrays=function t(r,e){const o={flattenArraysContainingStringsToBeEmpty:!1,...e},u=i(r);let c,a,f;if(Array.isArray(u)){if(o.flattenArraysContainingStringsToBeEmpty&&u.some((t=>"string"==typeof t)))return[];c=null,a={},f=0;for(let t=0,r=u.length;t<r;t++)y(u[t])&&(a=n(a,u[t]),null===c?(c=!0,f=t):(u.splice(t,1),t-=1));null!==c&&(u[f]=i(a))}return y(u)?Object.keys(u).forEach((r=>{(y(u[r])||Array.isArray(u[r]))&&(u[r]=t(u[r],o))})):Array.isArray(u)&&u.forEach(((r,e)=>{(y(u[e])||Array.isArray(u[e]))&&(u[e]=t(u[e],o))})),u},t.version="6.0.7",Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "object-flatten-all-arrays",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"description": "Merge and flatten any arrays found in all values within plain objects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arrays",
|
|
@@ -35,13 +35,12 @@
|
|
|
35
35
|
"types": "types/index.d.ts",
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "rollup -c",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
38
|
+
"build:esbuild": "node '../../scripts/esbuild.js'",
|
|
39
|
+
"build:esbuild:dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
40
|
+
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent",
|
|
40
41
|
"clean_types": "../../scripts/cleanTypes.js",
|
|
41
42
|
"dev": "rollup -c --dev",
|
|
42
43
|
"devunittest": "npm run dev && tap --only -R 'base'",
|
|
43
|
-
"esbuild": "node '../../scripts/esbuild.js'",
|
|
44
|
-
"esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
45
44
|
"format": "npm run lect && npm run prettier && npm run lint",
|
|
46
45
|
"lect": "lect",
|
|
47
46
|
"lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
|
|
@@ -50,17 +49,14 @@
|
|
|
50
49
|
"republish": "npm publish || :",
|
|
51
50
|
"tap": "tap",
|
|
52
51
|
"pretest": "npm run build",
|
|
53
|
-
"test": "npm run
|
|
52
|
+
"test": "npm run test:ci && npm run perf",
|
|
53
|
+
"test:ci": "npm run unittest && npm run test:examples && npm run format",
|
|
54
54
|
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
55
55
|
"tsc": "tsc",
|
|
56
|
-
"unittest": "tap --no-only --
|
|
56
|
+
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
|
|
57
57
|
},
|
|
58
58
|
"tap": {
|
|
59
59
|
"check-coverage": false,
|
|
60
|
-
"coverage-report": [
|
|
61
|
-
"json-summary",
|
|
62
|
-
"text"
|
|
63
|
-
],
|
|
64
60
|
"node-arg": [
|
|
65
61
|
"--no-warnings",
|
|
66
62
|
"--experimental-loader",
|
|
@@ -84,7 +80,7 @@
|
|
|
84
80
|
}
|
|
85
81
|
},
|
|
86
82
|
"dependencies": {
|
|
87
|
-
"@babel/runtime": "^7.16.
|
|
83
|
+
"@babel/runtime": "^7.16.3",
|
|
88
84
|
"lodash.clonedeep": "^4.5.0",
|
|
89
85
|
"lodash.isplainobject": "^4.0.6",
|
|
90
86
|
"lodash.merge": "^4.6.2"
|
|
@@ -98,8 +94,8 @@
|
|
|
98
94
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
99
95
|
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
100
96
|
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
101
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
102
|
-
"@babel/preset-env": "^7.16.
|
|
97
|
+
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
98
|
+
"@babel/preset-env": "^7.16.4",
|
|
103
99
|
"@babel/preset-typescript": "^7.16.0",
|
|
104
100
|
"@babel/register": "^7.16.0",
|
|
105
101
|
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
@@ -112,25 +108,25 @@
|
|
|
112
108
|
"@types/lodash.clonedeep": "^4.5.6",
|
|
113
109
|
"@types/lodash.isplainobject": "^4.0.6",
|
|
114
110
|
"@types/lodash.merge": "^4.6.6",
|
|
115
|
-
"@types/node": "^16.11.
|
|
111
|
+
"@types/node": "^16.11.10",
|
|
116
112
|
"@types/tap": "^15.0.5",
|
|
117
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
118
|
-
"@typescript-eslint/parser": "^5.
|
|
119
|
-
"core-js": "^3.19.
|
|
113
|
+
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
|
114
|
+
"@typescript-eslint/parser": "^5.5.0",
|
|
115
|
+
"core-js": "^3.19.2",
|
|
120
116
|
"cross-env": "^7.0.3",
|
|
121
|
-
"eslint": "^8.
|
|
122
|
-
"lect": "^0.18.
|
|
123
|
-
"rollup": "^2.
|
|
117
|
+
"eslint": "^8.3.0",
|
|
118
|
+
"lect": "^0.18.7",
|
|
119
|
+
"rollup": "^2.60.1",
|
|
124
120
|
"rollup-plugin-ascii": "^0.0.3",
|
|
125
121
|
"rollup-plugin-banner": "^0.2.1",
|
|
126
122
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
127
|
-
"rollup-plugin-dts": "^4.0.
|
|
123
|
+
"rollup-plugin-dts": "^4.0.1",
|
|
128
124
|
"rollup-plugin-terser": "^7.0.2",
|
|
129
|
-
"tap": "^15.
|
|
125
|
+
"tap": "^15.1.5",
|
|
130
126
|
"tslib": "^2.3.1",
|
|
131
|
-
"typescript": "^4.
|
|
127
|
+
"typescript": "^4.5.2"
|
|
132
128
|
},
|
|
133
129
|
"engines": {
|
|
134
|
-
"node": ">=
|
|
130
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
135
131
|
}
|
|
136
132
|
}
|