object-flatten-all-arrays 5.0.16 → 6.0.2
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
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.1 (2021-09-13)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
|
|
11
|
+
|
|
12
|
+
## 6.0.0 (2021-09-09)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- migrate to ES Modules ([8c9d95d](https://github.com/codsen/codsen/commit/8c9d95d5dea0b769c2f070397141918a4893d575))
|
|
17
|
+
|
|
18
|
+
### BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
- programs now are in ES Modules and won't work with Common JS require()
|
|
21
|
+
|
|
22
|
+
## 5.1.0 (2021-05-24)
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
- config file based major bump blacklisting ([e15f9bb](https://github.com/codsen/codsen/commit/e15f9bba1c4fd5f847ac28b3f38fa6ee633f5dca))
|
|
27
|
+
|
|
6
28
|
## 5.0.15 (2021-04-11)
|
|
7
29
|
|
|
8
30
|
### Reverts
|
package/README.md
CHANGED
|
@@ -26,10 +26,14 @@
|
|
|
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:
|
|
30
|
+
|
|
29
31
|
```bash
|
|
30
32
|
npm i object-flatten-all-arrays
|
|
31
33
|
```
|
|
32
34
|
|
|
35
|
+
If you need a legacy version which works with `require`, use version 5.1.0
|
|
36
|
+
|
|
33
37
|
## Quick Take
|
|
34
38
|
|
|
35
39
|
```js
|
|
@@ -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
|
|
4
|
+
* @version 6.0.2
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-flatten-all-arrays/}
|
|
@@ -11,7 +11,7 @@ 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 = "
|
|
14
|
+
var version$1 = "6.0.2";
|
|
15
15
|
|
|
16
16
|
const version = version$1;
|
|
17
17
|
function flattenAllArrays(originalIncommingObj, originalOpts) {
|
|
@@ -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
|
|
4
|
+
* @version 6.0.2
|
|
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:{};function e(t){var r={exports:{}};return t(r,r.exports),r.exports}var n=e((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,S=Object.prototype,x=_["__core-js_shared__"],z=Function.prototype.toString,E=S.hasOwnProperty,P=(A=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",F=S.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=S.propertyIsEnumerable,R=m.splice,L=U?U.toStringTag:void 0,N=function(){try{var t=_t(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),V=I?I.isBuffer:void 0,W=Math.max,q=Date.now,G=_t(_,"Map"),H=_t(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=jt(t),n=!e&>(t),o=!e&&!n&&Ot(t),i=!e&&!n&&!o&&zt(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)||yt(f,a))||c.push(f);return c}function tt(t,r,e){(void 0!==e&&!dt(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)&&dt(n,e)&&(void 0!==e||r in t)||nt(t,r,e)}function et(t,r){for(var e=t.length;e--;)if(dt(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=pt(this,t).delete(t);return this.size-=r?1:0,r},X.prototype.get=function(t){return pt(this,t).get(t)},X.prototype.has=function(t){return pt(this,t).has(t)},X.prototype.set=function(t,r){var e=pt(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 xt(t)&&ut(t)==i}function at(t){return!(!St(t)||function(t){return!!P&&P in t}(t))&&(wt(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=ht(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=vt(t,e),f=vt(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 _=jt(f),y=!_&&Ot(f),h=!_&&!y&&zt(f);l=f,_||y||h?jt(a)?l=a:xt(j=a)&&At(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(!xt(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)||gt(f)?(l=a,gt(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,Et(t))}(a):St(a)&&!wt(a)||(l=function(t){return"function"!=typeof t.constructor||ht(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(vt(t,u),i,u+"",t,r,o):void 0;void 0===a&&(a=i),tt(t,u,a)}}),Et)}function lt(t,r){return bt(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,$t),t+"")}function pt(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 _t(t,r){var e=function(t,r){return null==t?void 0:t[r]}(t,r);return at(e)?e:void 0}function yt(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 ht(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||S)}function vt(t,r){if(("constructor"!==r||"function"!=typeof t[r])&&"__proto__"!=r)return t[r]}var bt=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)}}(N?function(t,r){return N(t,"toString",{configurable:!0,enumerable:!1,value:(e=r,function(){return e}),writable:!0});var e}:$t);function dt(t,r){return t===r||t!=t&&r!=r}var gt=ct(function(){return arguments}())?ct:function(t){return xt(t)&&E.call(t,"callee")&&!D.call(t,"callee")},jt=Array.isArray;function At(t){return null!=t&&mt(t.length)&&!wt(t)}var Ot=V||function(){return!1};function wt(t){if(!St(t))return!1;var r=ut(t);return r==u||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}function mt(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 xt(t){return null!=t&&"object"==typeof t}var zt=g?function(t){return function(r){return t(r)}}(g):function(t){return xt(t)&&mt(t.length)&&!!s[ut(t)]};function Et(t){return At(t)?Z(t,!0):ft(t)}var Pt,Ft=(Pt=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=Pt.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?At(e)&&yt(r,e.length):"string"==n&&r in e)&&dt(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&&Pt(t,u,e,o)}return t})));function $t(t){return t}t.exports=Ft})),o=e((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]",S="[object Int32Array]",x="[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[S]=I[s]=I[l]=I[p]=I[y]=I[h]=I[v]=I[b]=I[x]=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 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 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 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 xt(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 S:case x: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}St.prototype.clear=function(){this.__data__=bt?bt(null):{}},St.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},St.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},St.prototype.has=function(t){var r=this.__data__;return bt?void 0!==r[t]:Z.call(r,t)},St.prototype.set=function(t,r){return this.__data__[t]=bt&&void 0===r?n:r,this},xt.prototype.clear=function(){this.__data__=[]},xt.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)},xt.prototype.get=function(t){var r=this.__data__,e=$t(r,t);return e<0?void 0:r[e][1]},xt.prototype.has=function(t){return $t(this.__data__,t)>-1},xt.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 St,map:new(_t||xt),string:new St}},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 xt},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 xt){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)}}));var i,u,c=Object.prototype,a=Function.prototype.toString,f=c.hasOwnProperty,s=a.call(Object),l=c.toString,p=(i=Object.getPrototypeOf,u=Object,function(t){return i(u(t))});var _=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=l.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=p(t);if(null===r)return!0;var e=f.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&a.call(e)==s};t.flattenAllArrays=function t(r,e){const i={flattenArraysContainingStringsToBeEmpty:!1,...e},u=o(r);let c,a,f;if(Array.isArray(u)){if(i.flattenArraysContainingStringsToBeEmpty&&u.some((t=>"string"==typeof t)))return[];c=null,a={},f=0;for(let t=0,r=u.length;t<r;t++)_(u[t])&&(a=n(a,u[t]),null===c?(c=!0,f=t):(u.splice(t,1),t-=1));null!==c&&(u[f]=o(a))}return _(u)?Object.keys(u).forEach((r=>{(_(u[r])||Array.isArray(u[r]))&&(u[r]=t(u[r],i))})):Array.isArray(u)&&u.forEach(((r,e)=>{(_(u[e])||Array.isArray(u[e]))&&(u[e]=t(u[e],i))})),u},t.version="5.0.16",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.2",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": "
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "Merge and flatten any arrays found in all values within plain objects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arrays",
|
|
@@ -27,9 +27,11 @@
|
|
|
27
27
|
"email": "roy@codsen.com",
|
|
28
28
|
"url": "https://codsen.com"
|
|
29
29
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
30
|
+
"type": "module",
|
|
31
|
+
"exports": {
|
|
32
|
+
"script": "./dist/object-flatten-all-arrays.umd.js",
|
|
33
|
+
"default": "./dist/object-flatten-all-arrays.esm.js"
|
|
34
|
+
},
|
|
33
35
|
"types": "types/index.d.ts",
|
|
34
36
|
"scripts": {
|
|
35
37
|
"build": "rollup -c",
|
|
@@ -49,18 +51,20 @@
|
|
|
49
51
|
"pretest": "npm run build",
|
|
50
52
|
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
|
|
51
53
|
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
52
|
-
"unittest": "
|
|
54
|
+
"unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf",
|
|
53
55
|
"clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
|
|
54
56
|
"clean_types": "../../scripts/cleanTypes.js"
|
|
55
57
|
},
|
|
56
58
|
"tap": {
|
|
59
|
+
"check-coverage": false,
|
|
57
60
|
"coverage-report": [
|
|
58
61
|
"json-summary",
|
|
59
62
|
"text"
|
|
60
63
|
],
|
|
61
|
-
"
|
|
62
|
-
"--
|
|
63
|
-
"--
|
|
64
|
+
"node-arg": [
|
|
65
|
+
"--no-warnings",
|
|
66
|
+
"--experimental-loader",
|
|
67
|
+
"@istanbuljs/esm-loader-hook"
|
|
64
68
|
],
|
|
65
69
|
"timeout": 0
|
|
66
70
|
},
|
|
@@ -80,50 +84,53 @@
|
|
|
80
84
|
}
|
|
81
85
|
},
|
|
82
86
|
"dependencies": {
|
|
83
|
-
"@babel/runtime": "^7.
|
|
87
|
+
"@babel/runtime": "^7.15.4",
|
|
84
88
|
"lodash.clonedeep": "^4.5.0",
|
|
85
89
|
"lodash.isplainobject": "^4.0.6",
|
|
86
90
|
"lodash.merge": "^4.6.2"
|
|
87
91
|
},
|
|
88
92
|
"devDependencies": {
|
|
89
|
-
"@babel/cli": "^7.
|
|
90
|
-
"@babel/core": "^7.
|
|
91
|
-
"@babel/node": "^7.
|
|
92
|
-
"@babel/plugin-external-helpers": "^7.
|
|
93
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
94
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.
|
|
95
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
96
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
97
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
98
|
-
"@babel/preset-env": "^7.
|
|
99
|
-
"@babel/preset-typescript": "^7.
|
|
100
|
-
"@babel/register": "^7.
|
|
93
|
+
"@babel/cli": "^7.15.4",
|
|
94
|
+
"@babel/core": "^7.15.5",
|
|
95
|
+
"@babel/node": "^7.15.4",
|
|
96
|
+
"@babel/plugin-external-helpers": "^7.14.5",
|
|
97
|
+
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
98
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
|
|
99
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.15.6",
|
|
100
|
+
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
|
|
101
|
+
"@babel/plugin-transform-runtime": "^7.15.0",
|
|
102
|
+
"@babel/preset-env": "^7.15.6",
|
|
103
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
104
|
+
"@babel/register": "^7.15.3",
|
|
105
|
+
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
101
106
|
"@rollup/plugin-babel": "^5.3.0",
|
|
102
|
-
"@rollup/plugin-commonjs": "^
|
|
107
|
+
"@rollup/plugin-commonjs": "^20.0.0",
|
|
103
108
|
"@rollup/plugin-json": "^4.1.0",
|
|
104
|
-
"@rollup/plugin-node-resolve": "^
|
|
105
|
-
"@rollup/plugin-
|
|
106
|
-
"@rollup/plugin-
|
|
107
|
-
"@rollup/plugin-typescript": "^8.2.1",
|
|
109
|
+
"@rollup/plugin-node-resolve": "^13.0.4",
|
|
110
|
+
"@rollup/plugin-strip": "^2.1.0",
|
|
111
|
+
"@rollup/plugin-typescript": "^8.2.5",
|
|
108
112
|
"@types/lodash.clonedeep": "^4.5.6",
|
|
109
113
|
"@types/lodash.isplainobject": "^4.0.6",
|
|
110
114
|
"@types/lodash.merge": "^4.6.6",
|
|
111
|
-
"@types/node": "^
|
|
112
|
-
"@types/tap": "^
|
|
113
|
-
"@typescript-eslint/eslint-plugin": "^4.
|
|
114
|
-
"@typescript-eslint/parser": "^4.
|
|
115
|
-
"core-js": "^3.
|
|
115
|
+
"@types/node": "^16.9.1",
|
|
116
|
+
"@types/tap": "^15.0.5",
|
|
117
|
+
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
|
118
|
+
"@typescript-eslint/parser": "^4.31.0",
|
|
119
|
+
"core-js": "^3.17.3",
|
|
116
120
|
"cross-env": "^7.0.3",
|
|
117
|
-
"eslint": "^7.
|
|
118
|
-
"lect": "^0.
|
|
119
|
-
"rollup": "^2.
|
|
121
|
+
"eslint": "^7.32.0",
|
|
122
|
+
"lect": "^0.18.2",
|
|
123
|
+
"rollup": "^2.56.3",
|
|
120
124
|
"rollup-plugin-ascii": "^0.0.3",
|
|
121
125
|
"rollup-plugin-banner": "^0.2.1",
|
|
122
126
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
123
|
-
"rollup-plugin-dts": "^
|
|
127
|
+
"rollup-plugin-dts": "^4.0.0",
|
|
124
128
|
"rollup-plugin-terser": "^7.0.2",
|
|
125
|
-
"tap": "^
|
|
126
|
-
"tslib": "^2.1
|
|
127
|
-
"typescript": "^4.
|
|
129
|
+
"tap": "^15.0.9",
|
|
130
|
+
"tslib": "^2.3.1",
|
|
131
|
+
"typescript": "^4.4.3"
|
|
132
|
+
},
|
|
133
|
+
"engines": {
|
|
134
|
+
"node": ">=12"
|
|
128
135
|
}
|
|
129
136
|
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @name object-flatten-all-arrays
|
|
3
|
-
* @fileoverview Merge and flatten any arrays found in all values within plain objects
|
|
4
|
-
* @version 5.0.16
|
|
5
|
-
* @author Roy Revelt, Codsen Ltd
|
|
6
|
-
* @license MIT
|
|
7
|
-
* {@link https://codsen.com/os/object-flatten-all-arrays/}
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
|
-
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
15
|
-
var merge = require('lodash.merge');
|
|
16
|
-
var clone = require('lodash.clonedeep');
|
|
17
|
-
var isObj = require('lodash.isplainobject');
|
|
18
|
-
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
22
|
-
var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
|
|
23
|
-
var clone__default = /*#__PURE__*/_interopDefaultLegacy(clone);
|
|
24
|
-
var isObj__default = /*#__PURE__*/_interopDefaultLegacy(isObj);
|
|
25
|
-
|
|
26
|
-
var version$1 = "5.0.16";
|
|
27
|
-
|
|
28
|
-
var version = version$1;
|
|
29
|
-
function flattenAllArrays(originalIncommingObj, originalOpts) {
|
|
30
|
-
function arrayContainsStr(arr) {
|
|
31
|
-
return arr.some(function (val) {
|
|
32
|
-
return typeof val === "string";
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
var defaults = {
|
|
36
|
-
flattenArraysContainingStringsToBeEmpty: false
|
|
37
|
-
};
|
|
38
|
-
var opts = _objectSpread__default['default'](_objectSpread__default['default']({}, defaults), originalOpts);
|
|
39
|
-
var incommingObj = clone__default['default'](originalIncommingObj);
|
|
40
|
-
var isFirstObj;
|
|
41
|
-
var combinedObj;
|
|
42
|
-
var firstObjIndex;
|
|
43
|
-
if (Array.isArray(incommingObj)) {
|
|
44
|
-
if (opts.flattenArraysContainingStringsToBeEmpty && arrayContainsStr(incommingObj)) {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
isFirstObj = null;
|
|
48
|
-
combinedObj = {};
|
|
49
|
-
firstObjIndex = 0;
|
|
50
|
-
for (var i = 0, len = incommingObj.length; i < len; i++) {
|
|
51
|
-
if (isObj__default['default'](incommingObj[i])) {
|
|
52
|
-
combinedObj = merge__default['default'](combinedObj, incommingObj[i]);
|
|
53
|
-
if (isFirstObj === null) {
|
|
54
|
-
isFirstObj = true;
|
|
55
|
-
firstObjIndex = i;
|
|
56
|
-
} else {
|
|
57
|
-
incommingObj.splice(i, 1);
|
|
58
|
-
i -= 1;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (isFirstObj !== null) {
|
|
63
|
-
incommingObj[firstObjIndex] = clone__default['default'](combinedObj);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (isObj__default['default'](incommingObj)) {
|
|
67
|
-
Object.keys(incommingObj).forEach(function (key) {
|
|
68
|
-
if (isObj__default['default'](incommingObj[key]) || Array.isArray(incommingObj[key])) {
|
|
69
|
-
incommingObj[key] = flattenAllArrays(incommingObj[key], opts);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
} else if (Array.isArray(incommingObj)) {
|
|
73
|
-
incommingObj.forEach(function (_el, i) {
|
|
74
|
-
if (isObj__default['default'](incommingObj[i]) || Array.isArray(incommingObj[i])) {
|
|
75
|
-
incommingObj[i] = flattenAllArrays(incommingObj[i], opts);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return incommingObj;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
exports.flattenAllArrays = flattenAllArrays;
|
|
83
|
-
exports.version = version;
|