object-flatten-all-arrays 6.0.6 → 6.0.12

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2021 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2022 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
package/README.md CHANGED
@@ -26,18 +26,17 @@
26
26
 
27
27
  ## Install
28
28
 
29
- This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
29
+ The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `5.1.0`.
30
30
 
31
31
  ```bash
32
32
  npm i object-flatten-all-arrays
33
33
  ```
34
34
 
35
- If you need a legacy version which works with `require`, use version 5.1.0
36
-
37
35
  ## Quick Take
38
36
 
39
37
  ```js
40
38
  import { strict as assert } from "assert";
39
+
41
40
  import { flattenAllArrays } from "object-flatten-all-arrays";
42
41
 
43
42
  assert.deepEqual(
@@ -72,7 +71,7 @@ assert.deepEqual(
72
71
 
73
72
  ## Documentation
74
73
 
75
- Please [visit codsen.com](https://codsen.com/os/object-flatten-all-arrays/) for a full description of the API and examples.
74
+ Please [visit codsen.com](https://codsen.com/os/object-flatten-all-arrays/) for a full description of the API.
76
75
 
77
76
  ## Contributing
78
77
 
@@ -82,6 +81,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
82
81
 
83
82
  MIT License
84
83
 
85
- Copyright (c) 2010-2021 Roy Revelt and other contributors
84
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
86
85
 
87
86
  <img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
@@ -1,71 +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.6
4
+ * @version 6.0.12
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
- import merge from 'lodash.merge';
11
- import clone from 'lodash.clonedeep';
12
- import isObj from 'lodash.isplainobject';
13
-
14
- var version$1 = "6.0.6";
15
-
16
- const version = version$1;
17
- function flattenAllArrays(originalIncommingObj, originalOpts) {
18
- function arrayContainsStr(arr) {
19
- return arr.some((val) => typeof val === "string");
20
- }
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 [];
33
- }
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
- });
60
- }
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
- });
67
- }
68
- return incommingObj;
69
- }
70
-
71
- export { flattenAllArrays, version };
10
+ import m from"lodash.merge";import p from"lodash.clonedeep";import a from"lodash.isplainobject";var o="6.0.12";var O=o;function c(d,y){function u(t){return t.some(r=>typeof r=="string")}let l={...{flattenArraysContainingStringsToBeEmpty:!1},...y},e=p(d),s,n,i;if(Array.isArray(e)){if(l.flattenArraysContainingStringsToBeEmpty&&u(e))return[];s=null,n={},i=0;for(let t=0,r=e.length;t<r;t++)a(e[t])&&(n=m(n,e[t]),s===null?(s=!0,i=t):(e.splice(t,1),t-=1));s!==null&&(e[i]=p(n))}return a(e)?Object.keys(e).forEach(t=>{(a(e[t])||Array.isArray(e[t]))&&(e[t]=c(e[t],l))}):Array.isArray(e)&&e.forEach((t,r)=>{(a(e[r])||Array.isArray(e[r]))&&(e[r]=c(e[r],l))}),e}export{c as flattenAllArrays,O as 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.6
4
+ * @version 6.0.12
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)&&gt(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)&&gt(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.6",Object.defineProperty(t,"__esModule",{value:!0})}));
10
+ var objectFlattenAllArrays=(()=>{var fr=Object.create;var D=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames,Ut=Object.getOwnPropertySymbols,dr=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty,hr=Object.prototype.propertyIsEnumerable;var Gt=(t,e,r)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,st=(t,e)=>{for(var r in e||(e={}))Bt.call(e,r)&&Gt(t,r,e[r]);if(Ut)for(var r of Ut(e))hr.call(e,r)&&Gt(t,r,e[r]);return t};var Ht=t=>D(t,"__esModule",{value:!0});var ct=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gr=(t,e)=>{for(var r in e)D(t,r,{get:e[r],enumerable:!0})},Lt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pr(e))!Bt.call(t,i)&&(r||i!=="default")&&D(t,i,{get:()=>e[i],enumerable:!(n=lr(e,i))||n.enumerable});return t},ut=(t,e)=>Lt(Ht(D(t!=null?fr(dr(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),_r=(t=>(e,r)=>t&&t.get(e)||(r=Lt(Ht({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var ge=ct((L,E)=>{var yr=200,Nt="__lodash_hash_undefined__",br=800,vr=16,zt=9007199254740991,$t="[object Arguments]",mr="[object Array]",Tr="[object AsyncFunction]",jr="[object Boolean]",Or="[object Date]",Ar="[object Error]",Kt="[object Function]",wr="[object GeneratorFunction]",Sr="[object Map]",Cr="[object Number]",xr="[object Null]",Vt="[object Object]",Ir="[object Proxy]",Er="[object RegExp]",Pr="[object Set]",Mr="[object String]",Rr="[object Undefined]",Fr="[object WeakMap]",Dr="[object ArrayBuffer]",Ur="[object DataView]",Br="[object Float32Array]",Gr="[object Float64Array]",Hr="[object Int8Array]",Lr="[object Int16Array]",Nr="[object Int32Array]",zr="[object Uint8Array]",$r="[object Uint8ClampedArray]",Kr="[object Uint16Array]",Vr="[object Uint32Array]",qr=/[\\^$.*+?()[\]{}|]/g,Wr=/^\[object .+?Constructor\]$/,Jr=/^(?:0|[1-9]\d*)$/,p={};p[Br]=p[Gr]=p[Hr]=p[Lr]=p[Nr]=p[zr]=p[$r]=p[Kr]=p[Vr]=!0;p[$t]=p[mr]=p[Dr]=p[jr]=p[Ur]=p[Or]=p[Ar]=p[Kt]=p[Sr]=p[Cr]=p[Vt]=p[Er]=p[Pr]=p[Mr]=p[Fr]=!1;var qt=typeof global=="object"&&global&&global.Object===Object&&global,Xr=typeof self=="object"&&self&&self.Object===Object&&self,U=qt||Xr||Function("return this")(),Wt=typeof L=="object"&&L&&!L.nodeType&&L,B=Wt&&typeof E=="object"&&E&&!E.nodeType&&E,Jt=B&&B.exports===Wt,ft=Jt&&qt.process,Xt=function(){try{var t=B&&B.require&&B.require("util").types;return t||ft&&ft.binding&&ft.binding("util")}catch(e){}}(),Yt=Xt&&Xt.isTypedArray;function Yr(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)}function Zr(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Qr(t){return function(e){return t(e)}}function kr(t,e){return t==null?void 0:t[e]}function tn(t,e){return function(r){return t(e(r))}}var en=Array.prototype,rn=Function.prototype,V=Object.prototype,lt=U["__core-js_shared__"],q=rn.toString,d=V.hasOwnProperty,Zt=function(){var t=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Qt=V.toString,nn=q.call(Object),an=RegExp("^"+q.call(d).replace(qr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=Jt?U.Buffer:void 0,kt=U.Symbol,te=U.Uint8Array,ee=W?W.allocUnsafe:void 0,re=tn(Object.getPrototypeOf,Object),ne=Object.create,on=V.propertyIsEnumerable,sn=en.splice,T=kt?kt.toStringTag:void 0,J=function(){try{var t=ht(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),cn=W?W.isBuffer:void 0,ae=Math.max,un=Date.now,ie=ht(U,"Map"),G=ht(Object,"create"),fn=function(){function t(){}return function(e){if(!O(e))return{};if(ne)return ne(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function j(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ln(){this.__data__=G?G(null):{},this.size=0}function pn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function dn(t){var e=this.__data__;if(G){var r=e[t];return r===Nt?void 0:r}return d.call(e,t)?e[t]:void 0}function hn(t){var e=this.__data__;return G?e[t]!==void 0:d.call(e,t)}function gn(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=G&&e===void 0?Nt:e,this}j.prototype.clear=ln;j.prototype.delete=pn;j.prototype.get=dn;j.prototype.has=hn;j.prototype.set=gn;function h(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function _n(){this.__data__=[],this.size=0}function yn(t){var e=this.__data__,r=X(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():sn.call(e,r,1),--this.size,!0}function bn(t){var e=this.__data__,r=X(e,t);return r<0?void 0:e[r][1]}function vn(t){return X(this.__data__,t)>-1}function mn(t,e){var r=this.__data__,n=X(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}h.prototype.clear=_n;h.prototype.delete=yn;h.prototype.get=bn;h.prototype.has=vn;h.prototype.set=mn;function x(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tn(){this.size=0,this.__data__={hash:new j,map:new(ie||h),string:new j}}function jn(t){var e=Z(this,t).delete(t);return this.size-=e?1:0,e}function On(t){return Z(this,t).get(t)}function An(t){return Z(this,t).has(t)}function wn(t,e){var r=Z(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}x.prototype.clear=Tn;x.prototype.delete=jn;x.prototype.get=On;x.prototype.has=An;x.prototype.set=wn;function I(t){var e=this.__data__=new h(t);this.size=e.size}function Sn(){this.__data__=new h,this.size=0}function Cn(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function xn(t){return this.__data__.get(t)}function In(t){return this.__data__.has(t)}function En(t,e){var r=this.__data__;if(r instanceof h){var n=r.__data__;if(!ie||n.length<yr-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new x(n)}return r.set(t,e),this.size=r.size,this}I.prototype.clear=Sn;I.prototype.delete=Cn;I.prototype.get=xn;I.prototype.has=In;I.prototype.set=En;function Pn(t,e){var r=yt(t),n=!r&&_t(t),i=!r&&!n&&fe(t),a=!r&&!n&&!i&&pe(t),s=r||n||i||a,o=s?Zr(t.length,String):[],u=o.length;for(var c in t)(e||d.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ce(c,u)))&&o.push(c);return o}function pt(t,e,r){(r!==void 0&&!Q(t[e],r)||r===void 0&&!(e in t))&&dt(t,e,r)}function Mn(t,e,r){var n=t[e];(!(d.call(t,e)&&Q(n,r))||r===void 0&&!(e in t))&&dt(t,e,r)}function X(t,e){for(var r=t.length;r--;)if(Q(t[r][0],e))return r;return-1}function dt(t,e,r){e=="__proto__"&&J?J(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Rn=qn();function Y(t){return t==null?t===void 0?Rr:xr:T&&T in Object(t)?Wn(t):kn(t)}function oe(t){return H(t)&&Y(t)==$t}function Fn(t){if(!O(t)||Zn(t))return!1;var e=vt(t)?an:Wr;return e.test(na(t))}function Dn(t){return H(t)&&le(t.length)&&!!p[Y(t)]}function Un(t){if(!O(t))return Qn(t);var e=ue(t),r=[];for(var n in t)n=="constructor"&&(e||!d.call(t,n))||r.push(n);return r}function se(t,e,r,n,i){t!==e&&Rn(e,function(a,s){if(i||(i=new I),O(a))Bn(t,e,s,r,se,n,i);else{var o=n?n(gt(t,s),a,s+"",t,e,i):void 0;o===void 0&&(o=a),pt(t,s,o)}},de)}function Bn(t,e,r,n,i,a,s){var o=gt(t,r),u=gt(e,r),c=s.get(u);if(c){pt(t,r,c);return}var l=a?a(o,u,r+"",t,e,s):void 0,y=l===void 0;if(y){var C=yt(u),v=!C&&fe(u),m=!C&&!v&&pe(u);l=u,C||v||m?yt(o)?l=o:aa(o)?l=$n(o):v?(y=!1,l=Ln(u,!0)):m?(y=!1,l=zn(u,!0)):l=[]:ia(u)||_t(u)?(l=o,_t(o)?l=oa(o):(!O(o)||vt(o))&&(l=Jn(u))):y=!1}y&&(s.set(u,l),i(l,u,n,a,s),s.delete(u)),pt(t,r,l)}function Gn(t,e){return ea(ta(t,e,he),t+"")}var Hn=J?function(t,e){return J(t,"toString",{configurable:!0,enumerable:!1,value:ca(e),writable:!0})}:he;function Ln(t,e){if(e)return t.slice();var r=t.length,n=ee?ee(r):new t.constructor(r);return t.copy(n),n}function Nn(t){var e=new t.constructor(t.byteLength);return new te(e).set(new te(t)),e}function zn(t,e){var r=e?Nn(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function $n(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Kn(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],u=n?n(r[o],t[o],o,r,t):void 0;u===void 0&&(u=t[o]),i?dt(r,o,u):Mn(r,o,u)}return r}function Vn(t){return Gn(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Xn(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}function qn(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var u=s[t?o:++i];if(r(a[u],u,a)===!1)break}return e}}function Z(t,e){var r=t.__data__;return Yn(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ht(t,e){var r=kr(t,e);return Fn(r)?r:void 0}function Wn(t){var e=d.call(t,T),r=t[T];try{t[T]=void 0;var n=!0}catch(a){}var i=Qt.call(t);return n&&(e?t[T]=r:delete t[T]),i}function Jn(t){return typeof t.constructor=="function"&&!ue(t)?fn(re(t)):{}}function ce(t,e){var r=typeof t;return e=e==null?zt:e,!!e&&(r=="number"||r!="symbol"&&Jr.test(t))&&t>-1&&t%1==0&&t<e}function Xn(t,e,r){if(!O(r))return!1;var n=typeof e;return(n=="number"?bt(r)&&ce(e,r.length):n=="string"&&e in r)?Q(r[e],t):!1}function Yn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Zn(t){return!!Zt&&Zt in t}function ue(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||V;return t===r}function Qn(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function kn(t){return Qt.call(t)}function ta(t,e,r){return e=ae(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=ae(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),Yr(t,this,o)}}function gt(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var ea=ra(Hn);function ra(t){var e=0,r=0;return function(){var n=un(),i=vr-(n-r);if(r=n,i>0){if(++e>=br)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function na(t){if(t!=null){try{return q.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Q(t,e){return t===e||t!==t&&e!==e}var _t=oe(function(){return arguments}())?oe:function(t){return H(t)&&d.call(t,"callee")&&!on.call(t,"callee")},yt=Array.isArray;function bt(t){return t!=null&&le(t.length)&&!vt(t)}function aa(t){return H(t)&&bt(t)}var fe=cn||ua;function vt(t){if(!O(t))return!1;var e=Y(t);return e==Kt||e==wr||e==Tr||e==Ir}function le(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=zt}function O(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function H(t){return t!=null&&typeof t=="object"}function ia(t){if(!H(t)||Y(t)!=Vt)return!1;var e=re(t);if(e===null)return!0;var r=d.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&q.call(r)==nn}var pe=Yt?Qr(Yt):Dn;function oa(t){return Kn(t,de(t))}function de(t){return bt(t)?Pn(t,!0):Un(t)}var sa=Vn(function(t,e,r){se(t,e,r)});function ca(t){return function(){return t}}function he(t){return t}function ua(){return!1}E.exports=sa});var nr=ct(($,F)=>{var fa=200,_e="__lodash_hash_undefined__",ye=9007199254740991,mt="[object Arguments]",la="[object Array]",be="[object Boolean]",ve="[object Date]",pa="[object Error]",Tt="[object Function]",me="[object GeneratorFunction]",k="[object Map]",Te="[object Number]",jt="[object Object]",je="[object Promise]",Oe="[object RegExp]",tt="[object Set]",Ae="[object String]",we="[object Symbol]",Ot="[object WeakMap]",Se="[object ArrayBuffer]",et="[object DataView]",Ce="[object Float32Array]",xe="[object Float64Array]",Ie="[object Int8Array]",Ee="[object Int16Array]",Pe="[object Int32Array]",Me="[object Uint8Array]",Re="[object Uint8ClampedArray]",Fe="[object Uint16Array]",De="[object Uint32Array]",da=/[\\^$.*+?()[\]{}|]/g,ha=/\w*$/,ga=/^\[object .+?Constructor\]$/,_a=/^(?:0|[1-9]\d*)$/,f={};f[mt]=f[la]=f[Se]=f[et]=f[be]=f[ve]=f[Ce]=f[xe]=f[Ie]=f[Ee]=f[Pe]=f[k]=f[Te]=f[jt]=f[Oe]=f[tt]=f[Ae]=f[we]=f[Me]=f[Re]=f[Fe]=f[De]=!0;f[pa]=f[Tt]=f[Ot]=!1;var ya=typeof global=="object"&&global&&global.Object===Object&&global,ba=typeof self=="object"&&self&&self.Object===Object&&self,g=ya||ba||Function("return this")(),Ue=typeof $=="object"&&$&&!$.nodeType&&$,Be=Ue&&typeof F=="object"&&F&&!F.nodeType&&F,va=Be&&Be.exports===Ue;function ma(t,e){return t.set(e[0],e[1]),t}function Ta(t,e){return t.add(e),t}function ja(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function Oa(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function Ge(t,e,r,n){var i=-1,a=t?t.length:0;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function Aa(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function wa(t,e){return t==null?void 0:t[e]}function He(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Le(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function At(t,e){return function(r){return t(e(r))}}function Ne(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Sa=Array.prototype,Ca=Function.prototype,rt=Object.prototype,wt=g["__core-js_shared__"],ze=function(){var t=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),$e=Ca.toString,b=rt.hasOwnProperty,nt=rt.toString,xa=RegExp("^"+$e.call(b).replace(da,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ke=va?g.Buffer:void 0,Ve=g.Symbol,qe=g.Uint8Array,Ia=At(Object.getPrototypeOf,Object),Ea=Object.create,Pa=rt.propertyIsEnumerable,Ma=Sa.splice,We=Object.getOwnPropertySymbols,Ra=Ke?Ke.isBuffer:void 0,Fa=At(Object.keys,Object),St=R(g,"DataView"),N=R(g,"Map"),Ct=R(g,"Promise"),xt=R(g,"Set"),It=R(g,"WeakMap"),z=R(Object,"create"),Da=S(St),Ua=S(N),Ba=S(Ct),Ga=S(xt),Ha=S(It),Je=Ve?Ve.prototype:void 0,Xe=Je?Je.valueOf:void 0;function A(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 La(){this.__data__=z?z(null):{}}function Na(t){return this.has(t)&&delete this.__data__[t]}function za(t){var e=this.__data__;if(z){var r=e[t];return r===_e?void 0:r}return b.call(e,t)?e[t]:void 0}function $a(t){var e=this.__data__;return z?e[t]!==void 0:b.call(e,t)}function Ka(t,e){var r=this.__data__;return r[t]=z&&e===void 0?_e:e,this}A.prototype.clear=La;A.prototype.delete=Na;A.prototype.get=za;A.prototype.has=$a;A.prototype.set=Ka;function _(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 Va(){this.__data__=[]}function qa(t){var e=this.__data__,r=at(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ma.call(e,r,1),!0}function Wa(t){var e=this.__data__,r=at(e,t);return r<0?void 0:e[r][1]}function Ja(t){return at(this.__data__,t)>-1}function Xa(t,e){var r=this.__data__,n=at(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}_.prototype.clear=Va;_.prototype.delete=qa;_.prototype.get=Wa;_.prototype.has=Ja;_.prototype.set=Xa;function P(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 Ya(){this.__data__={hash:new A,map:new(N||_),string:new A}}function Za(t){return it(this,t).delete(t)}function Qa(t){return it(this,t).get(t)}function ka(t){return it(this,t).has(t)}function ti(t,e){return it(this,t).set(t,e),this}P.prototype.clear=Ya;P.prototype.delete=Za;P.prototype.get=Qa;P.prototype.has=ka;P.prototype.set=ti;function M(t){this.__data__=new _(t)}function ei(){this.__data__=new _}function ri(t){return this.__data__.delete(t)}function ni(t){return this.__data__.get(t)}function ai(t){return this.__data__.has(t)}function ii(t,e){var r=this.__data__;if(r instanceof _){var n=r.__data__;if(!N||n.length<fa-1)return n.push([t,e]),this;r=this.__data__=new P(n)}return r.set(t,e),this}M.prototype.clear=ei;M.prototype.delete=ri;M.prototype.get=ni;M.prototype.has=ai;M.prototype.set=ii;function oi(t,e){var r=Mt(t)||Ei(t)?Aa(t.length,String):[],n=r.length,i=!!n;for(var a in t)(e||b.call(t,a))&&!(i&&(a=="length"||Si(a,n)))&&r.push(a);return r}function Ye(t,e,r){var n=t[e];(!(b.call(t,e)&&tr(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}function at(t,e){for(var r=t.length;r--;)if(tr(t[r][0],e))return r;return-1}function si(t,e){return t&&Ze(e,Rt(e),t)}function Et(t,e,r,n,i,a,s){var o;if(n&&(o=a?n(t,i,a,s):n(t)),o!==void 0)return o;if(!ot(t))return t;var u=Mt(t);if(u){if(o=Oi(t),!e)return mi(t,o)}else{var c=w(t),l=c==Tt||c==me;if(Mi(t))return di(t,e);if(c==jt||c==mt||l&&!a){if(He(t))return a?t:{};if(o=Ai(l?{}:t),!e)return Ti(t,si(o,t))}else{if(!f[c])return a?t:{};o=wi(t,c,Et,e)}}s||(s=new M);var y=s.get(t);if(y)return y;if(s.set(t,o),!u)var C=r?ji(t):Rt(t);return ja(C||t,function(v,m){C&&(m=v,v=t[m]),Ye(o,m,Et(v,e,r,n,m,t,s))}),o}function ci(t){return ot(t)?Ea(t):{}}function ui(t,e,r){var n=e(t);return Mt(t)?n:Oa(n,r(t))}function fi(t){return nt.call(t)}function li(t){if(!ot(t)||xi(t))return!1;var e=rr(t)||He(t)?xa:ga;return e.test(S(t))}function pi(t){if(!ke(t))return Fa(t);var e=[];for(var r in Object(t))b.call(t,r)&&r!="constructor"&&e.push(r);return e}function di(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function Pt(t){var e=new t.constructor(t.byteLength);return new qe(e).set(new qe(t)),e}function hi(t,e){var r=e?Pt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function gi(t,e,r){var n=e?r(Le(t),!0):Le(t);return Ge(n,ma,new t.constructor)}function _i(t){var e=new t.constructor(t.source,ha.exec(t));return e.lastIndex=t.lastIndex,e}function yi(t,e,r){var n=e?r(Ne(t),!0):Ne(t);return Ge(n,Ta,new t.constructor)}function bi(t){return Xe?Object(Xe.call(t)):{}}function vi(t,e){var r=e?Pt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function mi(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Ze(t,e,r,n){r||(r={});for(var i=-1,a=e.length;++i<a;){var s=e[i],o=n?n(r[s],t[s],s,r,t):void 0;Ye(r,s,o===void 0?t[s]:o)}return r}function Ti(t,e){return Ze(t,Qe(t),e)}function ji(t){return ui(t,Rt,Qe)}function it(t,e){var r=t.__data__;return Ci(e)?r[typeof e=="string"?"string":"hash"]:r.map}function R(t,e){var r=wa(t,e);return li(r)?r:void 0}var Qe=We?At(We,Object):Di,w=fi;(St&&w(new St(new ArrayBuffer(1)))!=et||N&&w(new N)!=k||Ct&&w(Ct.resolve())!=je||xt&&w(new xt)!=tt||It&&w(new It)!=Ot)&&(w=function(t){var e=nt.call(t),r=e==jt?t.constructor:void 0,n=r?S(r):void 0;if(n)switch(n){case Da:return et;case Ua:return k;case Ba:return je;case Ga:return tt;case Ha:return Ot}return e});function Oi(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&b.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Ai(t){return typeof t.constructor=="function"&&!ke(t)?ci(Ia(t)):{}}function wi(t,e,r,n){var i=t.constructor;switch(e){case Se:return Pt(t);case be:case ve:return new i(+t);case et:return hi(t,n);case Ce:case xe:case Ie:case Ee:case Pe:case Me:case Re:case Fe:case De:return vi(t,n);case k:return gi(t,n,r);case Te:case Ae:return new i(t);case Oe:return _i(t);case tt:return yi(t,n,r);case we:return bi(t)}}function Si(t,e){return e=e==null?ye:e,!!e&&(typeof t=="number"||_a.test(t))&&t>-1&&t%1==0&&t<e}function Ci(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function xi(t){return!!ze&&ze in t}function ke(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||rt;return t===r}function S(t){if(t!=null){try{return $e.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ii(t){return Et(t,!0,!0)}function tr(t,e){return t===e||t!==t&&e!==e}function Ei(t){return Pi(t)&&b.call(t,"callee")&&(!Pa.call(t,"callee")||nt.call(t)==mt)}var Mt=Array.isArray;function er(t){return t!=null&&Ri(t.length)&&!rr(t)}function Pi(t){return Fi(t)&&er(t)}var Mi=Ra||Ui;function rr(t){var e=ot(t)?nt.call(t):"";return e==Tt||e==me}function Ri(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ye}function ot(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Fi(t){return!!t&&typeof t=="object"}function Rt(t){return er(t)?oi(t):pi(t)}function Di(){return[]}function Ui(){return!1}F.exports=Ii});var sr=ct((Zi,or)=>{var Bi="[object Object]";function Gi(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Hi(t,e){return function(r){return t(e(r))}}var Li=Function.prototype,ar=Object.prototype,ir=Li.toString,Ni=ar.hasOwnProperty,zi=ir.call(Object),$i=ar.toString,Ki=Hi(Object.getPrototypeOf,Object);function Vi(t){return!!t&&typeof t=="object"}function qi(t){if(!Vi(t)||$i.call(t)!=Bi||Gi(t))return!1;var e=Ki(t);if(e===null)return!0;var r=Ni.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ir.call(r)==zi}or.exports=qi});var Xi={};gr(Xi,{flattenAllArrays:()=>Dt,version:()=>Ji});var ur=ut(ge(),1),Ft=ut(nr(),1),K=ut(sr(),1);var cr="6.0.12";var Ji=cr;function Dt(t,e){function r(c){return c.some(l=>typeof l=="string")}let i=st(st({},{flattenArraysContainingStringsToBeEmpty:!1}),e),a=(0,Ft.default)(t),s,o,u;if(Array.isArray(a)){if(i.flattenArraysContainingStringsToBeEmpty&&r(a))return[];s=null,o={},u=0;for(let c=0,l=a.length;c<l;c++)(0,K.default)(a[c])&&(o=(0,ur.default)(o,a[c]),s===null?(s=!0,u=c):(a.splice(c,1),c-=1));s!==null&&(a[u]=(0,Ft.default)(o))}return(0,K.default)(a)?Object.keys(a).forEach(c=>{((0,K.default)(a[c])||Array.isArray(a[c]))&&(a[c]=Dt(a[c],i))}):Array.isArray(a)&&a.forEach((c,l)=>{((0,K.default)(a[l])||Array.isArray(a[l]))&&(a[l]=Dt(a[l],i))}),a}return _r(Xi);})();
@@ -1,6 +1,7 @@
1
1
  // Quick Take
2
2
 
3
3
  import { strict as assert } from "assert";
4
+
4
5
  import { flattenAllArrays } from "../dist/object-flatten-all-arrays.esm.js";
5
6
 
6
7
  assert.deepEqual(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "object-flatten-all-arrays",
3
- "version": "6.0.6",
3
+ "version": "6.0.12",
4
4
  "description": "Merge and flatten any arrays found in all values within plain objects",
5
5
  "keywords": [
6
6
  "arrays",
@@ -34,99 +34,47 @@
34
34
  },
35
35
  "types": "types/index.d.ts",
36
36
  "scripts": {
37
- "build": "rollup -c",
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",
41
- "clean_types": "../../scripts/cleanTypes.js",
42
- "dev": "rollup -c --dev",
43
- "devunittest": "npm run dev && tap --only -R 'base'",
44
- "format": "npm run lect && npm run prettier && npm run lint",
45
- "lect": "lect",
46
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
47
- "perf": "node perf/check",
48
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
49
- "republish": "npm publish || :",
50
- "tap": "tap",
51
- "pretest": "npm run build",
52
- "test": "npm run test:ci && npm run perf",
53
- "test:ci": "npm run unittest && npm run test:examples && npm run format",
54
- "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
55
- "tsc": "tsc",
56
- "unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
37
+ "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
38
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
39
+ "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
40
+ "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
41
+ "examples": "node '../../ops/scripts/run-examples.js'",
42
+ "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
43
+ "letspublish": "yarn publish || :",
44
+ "lint": "eslint . --fix",
45
+ "perf": "node perf/check.js",
46
+ "prepare": "echo 'ready'",
47
+ "prettier": "prettier",
48
+ "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
49
+ "pretest": "yarn run lect && yarn run build",
50
+ "test": "yarn run devtest",
51
+ "unit": "uvu test"
57
52
  },
58
- "tap": {
59
- "check-coverage": false,
60
- "node-arg": [
61
- "--no-warnings",
62
- "--experimental-loader",
63
- "@istanbuljs/esm-loader-hook"
53
+ "engines": {
54
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
55
+ },
56
+ "c8": {
57
+ "check-coverage": true,
58
+ "exclude": [
59
+ "**/test/**/*.*"
64
60
  ],
65
- "timeout": 0
61
+ "lines": 100
66
62
  },
67
63
  "lect": {
68
64
  "licence": {
69
65
  "extras": [
70
66
  ""
71
67
  ]
72
- },
73
- "req": "{ flattenAllArrays }",
74
- "various": {
75
- "devDependencies": [
76
- "@types/lodash.clonedeep",
77
- "@types/lodash.isplainobject",
78
- "@types/lodash.merge"
79
- ]
80
68
  }
81
69
  },
82
70
  "dependencies": {
83
- "@babel/runtime": "^7.16.3",
84
71
  "lodash.clonedeep": "^4.5.0",
85
72
  "lodash.isplainobject": "^4.0.6",
86
73
  "lodash.merge": "^4.6.2"
87
74
  },
88
75
  "devDependencies": {
89
- "@babel/cli": "^7.16.0",
90
- "@babel/core": "^7.16.0",
91
- "@babel/node": "^7.16.0",
92
- "@babel/plugin-external-helpers": "^7.16.0",
93
- "@babel/plugin-proposal-class-properties": "^7.16.0",
94
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
95
- "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
96
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
97
- "@babel/plugin-transform-runtime": "^7.16.4",
98
- "@babel/preset-env": "^7.16.4",
99
- "@babel/preset-typescript": "^7.16.0",
100
- "@babel/register": "^7.16.0",
101
- "@istanbuljs/esm-loader-hook": "^0.1.2",
102
- "@rollup/plugin-babel": "^5.3.0",
103
- "@rollup/plugin-commonjs": "^21.0.1",
104
- "@rollup/plugin-json": "^4.1.0",
105
- "@rollup/plugin-node-resolve": "^13.0.6",
106
- "@rollup/plugin-strip": "^2.1.0",
107
- "@rollup/plugin-typescript": "^8.3.0",
108
76
  "@types/lodash.clonedeep": "^4.5.6",
109
77
  "@types/lodash.isplainobject": "^4.0.6",
110
- "@types/lodash.merge": "^4.6.6",
111
- "@types/node": "^16.11.9",
112
- "@types/tap": "^15.0.5",
113
- "@typescript-eslint/eslint-plugin": "^5.4.0",
114
- "@typescript-eslint/parser": "^5.4.0",
115
- "core-js": "^3.19.1",
116
- "cross-env": "^7.0.3",
117
- "eslint": "^8.3.0",
118
- "lect": "^0.18.6",
119
- "rollup": "^2.60.0",
120
- "rollup-plugin-ascii": "^0.0.3",
121
- "rollup-plugin-banner": "^0.2.1",
122
- "rollup-plugin-cleanup": "^3.2.1",
123
- "rollup-plugin-dts": "^4.0.1",
124
- "rollup-plugin-terser": "^7.0.2",
125
- "tap": "^15.1.2",
126
- "tslib": "^2.3.1",
127
- "typescript": "^4.5.2"
128
- },
129
- "engines": {
130
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
78
+ "@types/lodash.merge": "^4.6.6"
131
79
  }
132
80
  }
package/types/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  declare const version: string;
2
2
  interface Obj {
3
- [key: string]: any;
3
+ [key: string]: any;
4
4
  }
5
5
  interface Opts {
6
- flattenArraysContainingStringsToBeEmpty: boolean;
6
+ flattenArraysContainingStringsToBeEmpty: boolean;
7
7
  }
8
- declare function flattenAllArrays(originalIncommingObj: Obj, originalOpts?: Partial<Opts>): Obj;
8
+ declare function flattenAllArrays(
9
+ originalIncommingObj: Obj,
10
+ originalOpts?: Partial<Opts>
11
+ ): Obj;
9
12
 
10
13
  export { flattenAllArrays, version };
package/examples/api.json DELETED
@@ -1 +0,0 @@
1
- {"_quickTake.js":{"title":"Quick Take","content":"import &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; flattenAllArrays &#x7D; from \"object-flatten-all-arrays\";\n\nassert.deepEqual(\n flattenAllArrays(&#x7B;\n a: \"a\",\n b: \"b\",\n c: [\n &#x7B;\n b: \"b\",\n a: \"a\",\n &#x7D;,\n &#x7B;\n d: \"d\",\n c: \"c\",\n &#x7D;,\n ],\n &#x7D;),\n &#x7B;\n a: \"a\",\n b: \"b\",\n c: [\n &#x7B;\n a: \"a\",\n b: \"b\",\n c: \"c\",\n d: \"d\",\n &#x7D;,\n ],\n &#x7D;\n);"}}