object-flatten-all-arrays 7.1.3 → 7.2.1
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 +25 -2
- package/LICENSE +1 -1
- package/README.md +4 -3
- package/dist/object-flatten-all-arrays.esm.js +2 -2
- package/dist/object-flatten-all-arrays.umd.js +3 -16
- package/package.json +21 -25
- package/types/index.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,34 @@
|
|
|
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
|
-
## 7.1
|
|
6
|
+
## 7.2.1 (2026-08-22)
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
- optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
|
|
11
|
+
- record lodash-es removal benchmarks ([0f69b6f](https://github.com/codsen/codsen/commit/0f69b6fdb8c3be04eaa02f82de107390b5263ce9))
|
|
12
|
+
|
|
13
|
+
## 7.2.0 (2026-08-19)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
18
|
+
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
19
|
+
- trim production type dependencies ([426e081](https://github.com/codsen/codsen/commit/426e081f78e72bf3caecc138b339722309630dd8))
|
|
7
20
|
|
|
8
21
|
### Features
|
|
9
22
|
|
|
10
|
-
-
|
|
23
|
+
- add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
|
|
24
|
+
- refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
|
|
25
|
+
|
|
26
|
+
### Performance Improvements
|
|
27
|
+
|
|
28
|
+
- flatten arrays from a single cloned input ([e1cbcd8](https://github.com/codsen/codsen/commit/e1cbcd81e72719374b2357a4847ed8edd2274ea0))
|
|
29
|
+
|
|
30
|
+
### Reverts
|
|
31
|
+
|
|
32
|
+
- Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
|
|
33
|
+
- Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
|
|
11
34
|
|
|
12
35
|
## 7.0.19 (2024-03-30)
|
|
13
36
|
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2010-
|
|
3
|
+
Copyright © 2010-2026 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
|
@@ -32,7 +32,7 @@ npm i object-flatten-all-arrays
|
|
|
32
32
|
## Quick Take
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
import { strict as assert } from "assert";
|
|
35
|
+
import { strict as assert } from "node:assert";
|
|
36
36
|
|
|
37
37
|
import { flattenAllArrays } from "object-flatten-all-arrays";
|
|
38
38
|
|
|
@@ -66,9 +66,10 @@ assert.deepEqual(
|
|
|
66
66
|
);
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
|
|
69
70
|
## Documentation
|
|
70
71
|
|
|
71
|
-
Please [visit codsen.com](https://codsen.com/os/object-flatten-all-arrays/) for a full description of the API.
|
|
72
|
+
Please [visit codsen.com](https://codsen.com/os/object-flatten-all-arrays/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/object-flatten-all-arrays/CHANGELOG.md).
|
|
72
73
|
|
|
73
74
|
## Contributing
|
|
74
75
|
|
|
@@ -78,6 +79,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
78
79
|
|
|
79
80
|
MIT License
|
|
80
81
|
|
|
81
|
-
Copyright © 2010-
|
|
82
|
+
Copyright © 2010-2026 Roy Revelt and other contributors
|
|
82
83
|
|
|
83
84
|
<p align="center"><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"></p>
|
|
@@ -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 7.1
|
|
4
|
+
* @version 7.2.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-flatten-all-arrays/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{
|
|
10
|
+
import{isPlainObject as c}from"codsen-utils";var y="7.2.1";var h=y,d={flattenArraysContainingStringsToBeEmpty:!1},b=Object.prototype.hasOwnProperty;function i(t,n,r){n==="__proto__"?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}function p(t){if(Array.isArray(t)){let n=new Array(t.length),r=t;for(let a of Object.keys(t))i(n,a,p(r[a]));return n}if(c(t)){let n={};for(let r of Object.keys(t))i(n,r,p(t[r]));return n}return t}function f(t,n){for(let r of Object.keys(n)){let a=n[r],e=b.call(t,r),o=e?t[r]:void 0;if(Array.isArray(a)){let l=Array.isArray(o)?o:[];i(t,r,f(l,a))}else if(c(a)){let l=c(o)?o:{};i(t,r,f(l,a))}else(a!==void 0||!e)&&i(t,r,a)}return t}function k(t,n){let r={...d,...n};function a(e){if(Array.isArray(e)){if(r.flattenArraysContainingStringsToBeEmpty&&e.some(s=>typeof s=="string"))return[];let o=-1,l={};for(let s=0;s<e.length;s++)c(e[s])&&(l=f(l,e[s]),o===-1?o=s:(e.splice(s,1),s-=1));o!==-1&&(e[o]=l);for(let s=0;s<e.length;s++)(c(e[s])||Array.isArray(e[s]))&&(e[s]=a(e[s]))}else if(c(e))for(let o of Object.keys(e))(c(e[o])||Array.isArray(e[o]))&&(e[o]=a(e[o]));return e}return a(r.reuseInput?t:p(t))}export{d as defaults,k as flattenAllArrays,h as version};
|
|
@@ -1,31 +1,18 @@
|
|
|
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 7.1
|
|
4
|
+
* @version 7.2.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-flatten-all-arrays/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var objectFlattenAllArrays=(()=>{var Ve=Object.create;var R=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames,lt=Object.getOwnPropertySymbols,Je=Object.getPrototypeOf,dt=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable;var mt=(t,e,r)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,et=(t,e)=>{for(var r in e||(e={}))dt.call(e,r)&&mt(t,r,e[r]);if(lt)for(var r of lt(e))Qe.call(e,r)&&mt(t,r,e[r]);return t};var Ze=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Xe=(t,e)=>{for(var r in e)R(t,r,{get:e[r],enumerable:!0})},ct=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of Ke(e))!dt.call(t,f)&&f!==r&&R(t,f,{get:()=>e[f],enumerable:!(a=qe(e,f))||a.enumerable});return t};var xt=(t,e,r)=>(r=t!=null?Ve(Je(t)):{},ct(e||!t||!t.__esModule?R(r,"default",{value:t,enumerable:!0}):r,t)),Ye=t=>ct(R({},"__esModule",{value:!0}),t);var it=Ze((Qu,We)=>{"use strict";We.exports=uf;function L(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function uf(t){if(t=t||{},t.circles)return pf(t);let e=new Map;if(e.set(Date,s=>new Date(s)),e.set(Map,(s,i)=>new Map(a(Array.from(s),i))),e.set(Set,(s,i)=>new Set(a(Array.from(s),i))),t.constructorHandlers)for(let s of t.constructorHandlers)e.set(s[0],s[1]);let r=null;return t.proto?u:f;function a(s,i){let o=Object.keys(s),n=new Array(o.length);for(let l=0;l<o.length;l++){let p=o[l],d=s[p];typeof d!="object"||d===null?n[p]=d:d.constructor!==Object&&(r=e.get(d.constructor))?n[p]=r(d,i):ArrayBuffer.isView(d)?n[p]=L(d):n[p]=i(d)}return n}function f(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return a(s,f);if(s.constructor!==Object&&(r=e.get(s.constructor)))return r(s,f);let i={};for(let o in s){if(Object.hasOwnProperty.call(s,o)===!1)continue;let n=s[o];typeof n!="object"||n===null?i[o]=n:n.constructor!==Object&&(r=e.get(n.constructor))?i[o]=r(n,f):ArrayBuffer.isView(n)?i[o]=L(n):i[o]=f(n)}return i}function u(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return a(s,u);if(s.constructor!==Object&&(r=e.get(s.constructor)))return r(s,u);let i={};for(let o in s){let n=s[o];typeof n!="object"||n===null?i[o]=n:n.constructor!==Object&&(r=e.get(n.constructor))?i[o]=r(n,u):ArrayBuffer.isView(n)?i[o]=L(n):i[o]=u(n)}return i}}function pf(t){let e=[],r=[],a=new Map;if(a.set(Date,o=>new Date(o)),a.set(Map,(o,n)=>new Map(u(Array.from(o),n))),a.set(Set,(o,n)=>new Set(u(Array.from(o),n))),t.constructorHandlers)for(let o of t.constructorHandlers)a.set(o[0],o[1]);let f=null;return t.proto?i:s;function u(o,n){let l=Object.keys(o),p=new Array(l.length);for(let d=0;d<l.length;d++){let y=l[d],x=o[y];if(typeof x!="object"||x===null)p[y]=x;else if(x.constructor!==Object&&(f=a.get(x.constructor)))p[y]=f(x,n);else if(ArrayBuffer.isView(x))p[y]=L(x);else{let pt=e.indexOf(x);pt!==-1?p[y]=r[pt]:p[y]=n(x)}}return p}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return u(o,s);if(o.constructor!==Object&&(f=a.get(o.constructor)))return f(o,s);let n={};e.push(o),r.push(n);for(let l in o){if(Object.hasOwnProperty.call(o,l)===!1)continue;let p=o[l];if(typeof p!="object"||p===null)n[l]=p;else if(p.constructor!==Object&&(f=a.get(p.constructor)))n[l]=f(p,s);else if(ArrayBuffer.isView(p))n[l]=L(p);else{let d=e.indexOf(p);d!==-1?n[l]=r[d]:n[l]=s(p)}}return e.pop(),r.pop(),n}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return u(o,i);if(o.constructor!==Object&&(f=a.get(o.constructor)))return f(o,i);let n={};e.push(o),r.push(n);for(let l in o){let p=o[l];if(typeof p!="object"||p===null)n[l]=p;else if(p.constructor!==Object&&(f=a.get(p.constructor)))n[l]=f(p,i);else if(ArrayBuffer.isView(p))n[l]=L(p);else{let d=e.indexOf(p);d!==-1?n[l]=r[d]:n[l]=i(p)}}return e.pop(),r.pop(),n}}});var df={};Xe(df,{defaults:()=>$e,flattenAllArrays:()=>ut,version:()=>mf});var tr=typeof global=="object"&&global&&global.Object===Object&&global,G=tr;var er=typeof self=="object"&&self&&self.Object===Object&&self,rr=G||er||Function("return this")(),h=rr;var or=h.Symbol,w=or;var ht=Object.prototype,ar=ht.hasOwnProperty,fr=ht.toString,F=w?w.toStringTag:void 0;function sr(t){var e=ar.call(t,F),r=t[F];try{t[F]=void 0;var a=!0}catch(u){}var f=fr.call(t);return a&&(e?t[F]=r:delete t[F]),f}var yt=sr;var nr=Object.prototype,ir=nr.toString;function ur(t){return ir.call(t)}var gt=ur;var pr="[object Null]",lr="[object Undefined]",bt=w?w.toStringTag:void 0;function mr(t){return t==null?t===void 0?lr:pr:bt&&bt in Object(t)?yt(t):gt(t)}var v=mr;function dr(t){return t!=null&&typeof t=="object"}var g=dr;var cr=Array.isArray,N=cr;function xr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var c=xr;function hr(t){return t}var $=hr;var yr="[object AsyncFunction]",gr="[object Function]",br="[object GeneratorFunction]",vr="[object Proxy]";function Or(t){if(!c(t))return!1;var e=v(t);return e==gr||e==br||e==yr||e==vr}var C=Or;var Ar=h["__core-js_shared__"],V=Ar;var vt=(function(){var t=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function jr(t){return!!vt&&vt in t}var Ot=jr;var _r=Function.prototype,wr=_r.toString;function Cr(t){if(t!=null){try{return wr.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var At=Cr;var Tr=/[\\^$.*+?()[\]{}|]/g,Sr=/^\[object .+?Constructor\]$/,Ir=Function.prototype,Pr=Object.prototype,Br=Ir.toString,Er=Pr.hasOwnProperty,Dr=RegExp("^"+Br.call(Er).replace(Tr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mr(t){if(!c(t)||Ot(t))return!1;var e=C(t)?Dr:Sr;return e.test(At(t))}var jt=Mr;function Lr(t,e){return t==null?void 0:t[e]}var _t=Lr;function Rr(t,e){var r=_t(t,e);return jt(r)?r:void 0}var T=Rr;var wt=Object.create,Fr=(function(){function t(){}return function(e){if(!c(e))return{};if(wt)return wt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),Ct=Fr;function Nr(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)}var Tt=Nr;function kr(t,e){var r=-1,a=t.length;for(e||(e=Array(a));++r<a;)e[r]=t[r];return e}var St=kr;var Wr=800,zr=16,Ur=Date.now;function Hr(t){var e=0,r=0;return function(){var a=Ur(),f=zr-(a-r);if(r=a,f>0){if(++e>=Wr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var It=Hr;function Gr(t){return function(){return t}}var Pt=Gr;var $r=(function(){try{var t=T(Object,"defineProperty");return t({},"",{}),t}catch(e){}})(),S=$r;var Vr=S?function(t,e){return S(t,"toString",{configurable:!0,enumerable:!1,value:Pt(e),writable:!0})}:$,Bt=Vr;var qr=It(Bt),Et=qr;var Kr=9007199254740991,Jr=/^(?:0|[1-9]\d*)$/;function Qr(t,e){var r=typeof t;return e=e==null?Kr:e,!!e&&(r=="number"||r!="symbol"&&Jr.test(t))&&t>-1&&t%1==0&&t<e}var q=Qr;function Zr(t,e,r){e=="__proto__"&&S?S(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var I=Zr;function Xr(t,e){return t===e||t!==t&&e!==e}var O=Xr;var Yr=Object.prototype,to=Yr.hasOwnProperty;function eo(t,e,r){var a=t[e];(!(to.call(t,e)&&O(a,r))||r===void 0&&!(e in t))&&I(t,e,r)}var Dt=eo;function ro(t,e,r,a){var f=!r;r||(r={});for(var u=-1,s=e.length;++u<s;){var i=e[u],o=a?a(r[i],t[i],i,r,t):void 0;o===void 0&&(o=t[i]),f?I(r,i,o):Dt(r,i,o)}return r}var Mt=ro;var Lt=Math.max;function oo(t,e,r){return e=Lt(e===void 0?t.length-1:e,0),function(){for(var a=arguments,f=-1,u=Lt(a.length-e,0),s=Array(u);++f<u;)s[f]=a[e+f];f=-1;for(var i=Array(e+1);++f<e;)i[f]=a[f];return i[e]=r(s),Tt(t,this,i)}}var Rt=oo;function ao(t,e){return Et(Rt(t,e,$),t+"")}var Ft=ao;var fo=9007199254740991;function so(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=fo}var K=so;function no(t){return t!=null&&K(t.length)&&!C(t)}var P=no;function io(t,e,r){if(!c(r))return!1;var a=typeof e;return(a=="number"?P(r)&&q(e,r.length):a=="string"&&e in r)?O(r[e],t):!1}var Nt=io;function uo(t){return Ft(function(e,r){var a=-1,f=r.length,u=f>1?r[f-1]:void 0,s=f>2?r[2]:void 0;for(u=t.length>3&&typeof u=="function"?(f--,u):void 0,s&&Nt(r[0],r[1],s)&&(u=f<3?void 0:u,f=1),e=Object(e);++a<f;){var i=r[a];i&&t(e,i,a,u)}return e})}var kt=uo;var po=Object.prototype;function lo(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||po;return t===r}var J=lo;function mo(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}var Wt=mo;var co="[object Arguments]";function xo(t){return g(t)&&v(t)==co}var rt=xo;var zt=Object.prototype,ho=zt.hasOwnProperty,yo=zt.propertyIsEnumerable,go=rt((function(){return arguments})())?rt:function(t){return g(t)&&ho.call(t,"callee")&&!yo.call(t,"callee")},k=go;function bo(){return!1}var Ut=bo;var $t=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ht=$t&&typeof module=="object"&&module&&!module.nodeType&&module,vo=Ht&&Ht.exports===$t,Gt=vo?h.Buffer:void 0,Oo=Gt?Gt.isBuffer:void 0,Ao=Oo||Ut,Q=Ao;var jo="[object Arguments]",_o="[object Array]",wo="[object Boolean]",Co="[object Date]",To="[object Error]",So="[object Function]",Io="[object Map]",Po="[object Number]",Bo="[object Object]",Eo="[object RegExp]",Do="[object Set]",Mo="[object String]",Lo="[object WeakMap]",Ro="[object ArrayBuffer]",Fo="[object DataView]",No="[object Float32Array]",ko="[object Float64Array]",Wo="[object Int8Array]",zo="[object Int16Array]",Uo="[object Int32Array]",Ho="[object Uint8Array]",Go="[object Uint8ClampedArray]",$o="[object Uint16Array]",Vo="[object Uint32Array]",m={};m[No]=m[ko]=m[Wo]=m[zo]=m[Uo]=m[Ho]=m[Go]=m[$o]=m[Vo]=!0;m[jo]=m[_o]=m[Ro]=m[wo]=m[Fo]=m[Co]=m[To]=m[So]=m[Io]=m[Po]=m[Bo]=m[Eo]=m[Do]=m[Mo]=m[Lo]=!1;function qo(t){return g(t)&&K(t.length)&&!!m[v(t)]}var Vt=qo;function Ko(t){return function(e){return t(e)}}var qt=Ko;var Kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,W=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,Jo=W&&W.exports===Kt,ot=Jo&&G.process,Qo=(function(){try{var t=W&&W.require&&W.require("util").types;return t||ot&&ot.binding&&ot.binding("util")}catch(e){}})(),at=Qo;var Jt=at&&at.isTypedArray,Zo=Jt?qt(Jt):Vt,Z=Zo;var Xo=Object.prototype,Yo=Xo.hasOwnProperty;function ta(t,e){var r=N(t),a=!r&&k(t),f=!r&&!a&&Q(t),u=!r&&!a&&!f&&Z(t),s=r||a||f||u,i=s?Wt(t.length,String):[],o=i.length;for(var n in t)(e||Yo.call(t,n))&&!(s&&(n=="length"||f&&(n=="offset"||n=="parent")||u&&(n=="buffer"||n=="byteLength"||n=="byteOffset")||q(n,o)))&&i.push(n);return i}var Qt=ta;function ea(t,e){return function(r){return t(e(r))}}var Zt=ea;function ra(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Xt=ra;var oa=Object.prototype,aa=oa.hasOwnProperty;function fa(t){if(!c(t))return Xt(t);var e=J(t),r=[];for(var a in t)a=="constructor"&&(e||!aa.call(t,a))||r.push(a);return r}var Yt=fa;function sa(t){return P(t)?Qt(t,!0):Yt(t)}var X=sa;var na=T(Object,"create"),b=na;function ia(){this.__data__=b?b(null):{},this.size=0}var te=ia;function ua(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ee=ua;var pa="__lodash_hash_undefined__",la=Object.prototype,ma=la.hasOwnProperty;function da(t){var e=this.__data__;if(b){var r=e[t];return r===pa?void 0:r}return ma.call(e,t)?e[t]:void 0}var re=da;var ca=Object.prototype,xa=ca.hasOwnProperty;function ha(t){var e=this.__data__;return b?e[t]!==void 0:xa.call(e,t)}var oe=ha;var ya="__lodash_hash_undefined__";function ga(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?ya:e,this}var ae=ga;function B(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}B.prototype.clear=te;B.prototype.delete=ee;B.prototype.get=re;B.prototype.has=oe;B.prototype.set=ae;var ft=B;function ba(){this.__data__=[],this.size=0}var fe=ba;function va(t,e){for(var r=t.length;r--;)if(O(t[r][0],e))return r;return-1}var A=va;var Oa=Array.prototype,Aa=Oa.splice;function ja(t){var e=this.__data__,r=A(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():Aa.call(e,r,1),--this.size,!0}var se=ja;function _a(t){var e=this.__data__,r=A(e,t);return r<0?void 0:e[r][1]}var ne=_a;function wa(t){return A(this.__data__,t)>-1}var ie=wa;function Ca(t,e){var r=this.__data__,a=A(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}var ue=Ca;function E(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}E.prototype.clear=fe;E.prototype.delete=se;E.prototype.get=ne;E.prototype.has=ie;E.prototype.set=ue;var j=E;var Ta=T(h,"Map"),Y=Ta;function Sa(){this.size=0,this.__data__={hash:new ft,map:new(Y||j),string:new ft}}var pe=Sa;function Ia(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var le=Ia;function Pa(t,e){var r=t.__data__;return le(e)?r[typeof e=="string"?"string":"hash"]:r.map}var _=Pa;function Ba(t){var e=_(this,t).delete(t);return this.size-=e?1:0,e}var me=Ba;function Ea(t){return _(this,t).get(t)}var de=Ea;function Da(t){return _(this,t).has(t)}var ce=Da;function Ma(t,e){var r=_(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}var xe=Ma;function D(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}D.prototype.clear=pe;D.prototype.delete=me;D.prototype.get=de;D.prototype.has=ce;D.prototype.set=xe;var he=D;var La=Zt(Object.getPrototypeOf,Object),tt=La;var Ra="[object Object]",Fa=Function.prototype,Na=Object.prototype,ye=Fa.toString,ka=Na.hasOwnProperty,Wa=ye.call(Object);function za(t){if(!g(t)||v(t)!=Ra)return!1;var e=tt(t);if(e===null)return!0;var r=ka.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ye.call(r)==Wa}var ge=za;function Ua(){this.__data__=new j,this.size=0}var be=Ua;function Ha(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ve=Ha;function Ga(t){return this.__data__.get(t)}var Oe=Ga;function $a(t){return this.__data__.has(t)}var Ae=$a;var Va=200;function qa(t,e){var r=this.__data__;if(r instanceof j){var a=r.__data__;if(!Y||a.length<Va-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new he(a)}return r.set(t,e),this.size=r.size,this}var je=qa;function M(t){var e=this.__data__=new j(t);this.size=e.size}M.prototype.clear=be;M.prototype.delete=ve;M.prototype.get=Oe;M.prototype.has=Ae;M.prototype.set=je;var _e=M;var Se=typeof exports=="object"&&exports&&!exports.nodeType&&exports,we=Se&&typeof module=="object"&&module&&!module.nodeType&&module,Ka=we&&we.exports===Se,Ce=Ka?h.Buffer:void 0,Te=Ce?Ce.allocUnsafe:void 0;function Ja(t,e){if(e)return t.slice();var r=t.length,a=Te?Te(r):new t.constructor(r);return t.copy(a),a}var Ie=Ja;var Qa=h.Uint8Array,st=Qa;function Za(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}var Pe=Za;function Xa(t,e){var r=e?Pe(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Be=Xa;function Ya(t){return typeof t.constructor=="function"&&!J(t)?Ct(tt(t)):{}}var Ee=Ya;function tf(t){return function(e,r,a){for(var f=-1,u=Object(e),s=a(e),i=s.length;i--;){var o=s[t?i:++f];if(r(u[o],o,u)===!1)break}return e}}var De=tf;var ef=De(),Me=ef;function rf(t,e,r){(r!==void 0&&!O(t[e],r)||r===void 0&&!(e in t))&&I(t,e,r)}var z=rf;function of(t){return g(t)&&P(t)}var Le=of;function af(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var U=af;function ff(t){return Mt(t,X(t))}var Re=ff;function sf(t,e,r,a,f,u,s){var i=U(t,r),o=U(e,r),n=s.get(o);if(n){z(t,r,n);return}var l=u?u(i,o,r+"",t,e,s):void 0,p=l===void 0;if(p){var d=N(o),y=!d&&Q(o),x=!d&&!y&&Z(o);l=o,d||y||x?N(i)?l=i:Le(i)?l=St(i):y?(p=!1,l=Ie(o,!0)):x?(p=!1,l=Be(o,!0)):l=[]:ge(o)||k(o)?(l=i,k(i)?l=Re(i):(!c(i)||C(i))&&(l=Ee(o))):p=!1}p&&(s.set(o,l),f(l,o,a,u,s),s.delete(o)),z(t,r,l)}var Fe=sf;function Ne(t,e,r,a,f){t!==e&&Me(e,function(u,s){if(f||(f=new _e),c(u))Fe(t,e,s,r,Ne,a,f);else{var i=a?a(U(t,s),u,s+"",t,e,f):void 0;i===void 0&&(i=u),z(t,s,i)}},X)}var ke=Ne;var nf=kt(function(t,e,r){ke(t,e,r)}),nt=nf;var Ge=xt(it(),1);var ze=xt(it(),1);var Zu=(0,ze.default)();function H(t){if(t==null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}var Ue="7.1.3";var He=(0,Ge.default)(),mf=Ue,$e={flattenArraysContainingStringsToBeEmpty:!1};function ut(t,e){function r(o){return o.some(n=>typeof n=="string")}let a=et(et({},$e),e),f=He(t),u,s,i;if(Array.isArray(f)){if(a.flattenArraysContainingStringsToBeEmpty&&r(f))return[];u=null,s={},i=0;for(let o=0,n=f.length;o<n;o++)H(f[o])&&(s=nt(s,f[o]),u===null?(u=!0,i=o):(f.splice(o,1),o-=1));u!==null&&(f[i]=He(s))}return H(f)?Object.keys(f).forEach(o=>{(H(f[o])||Array.isArray(f[o]))&&(f[o]=ut(f[o],a))}):Array.isArray(f)&&f.forEach((o,n)=>{(H(f[n])||Array.isArray(f[n]))&&(f[n]=ut(f[n],a))}),f}return Ye(df);})();
|
|
10
|
+
"use strict";var objectFlattenAllArrays=(()=>{var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var g=(e,t,r)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))y.call(t,r)&&g(e,r,t[r]);if(h)for(var r of h(t))j.call(t,r)&&g(e,r,t[r]);return e};var w=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of O(t))!y.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(s=v(t,n))||s.enumerable});return e};var x=e=>C(f({},"__esModule",{value:!0}),e);var W={};w(W,{defaults:()=>A,flattenAllArrays:()=>R,version:()=>S});var B=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);function o(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}var b,M=(b=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:b.get;var P=Date.prototype.getTime;var m="7.2.1";var S=m,A={flattenArraysContainingStringsToBeEmpty:!1},D=Object.prototype.hasOwnProperty;function u(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function p(e){if(Array.isArray(e)){let t=new Array(e.length),r=e;for(let s of Object.keys(e))u(t,s,p(r[s]));return t}if(o(e)){let t={};for(let r of Object.keys(e))u(t,r,p(e[r]));return t}return e}function d(e,t){for(let r of Object.keys(t)){let s=t[r],n=D.call(e,r),l=n?e[r]:void 0;if(Array.isArray(s)){let a=Array.isArray(l)?l:[];u(e,r,d(a,s))}else if(o(s)){let a=o(l)?l:{};u(e,r,d(a,s))}else(s!==void 0||!n)&&u(e,r,s)}return e}function R(e,t){let r=c(c({},A),t);function s(n){if(Array.isArray(n)){if(r.flattenArraysContainingStringsToBeEmpty&&n.some(i=>typeof i=="string"))return[];let l=-1,a={};for(let i=0;i<n.length;i++)o(n[i])&&(a=d(a,n[i]),l===-1?l=i:(n.splice(i,1),i-=1));l!==-1&&(n[l]=a);for(let i=0;i<n.length;i++)(o(n[i])||Array.isArray(n[i]))&&(n[i]=s(n[i]))}else if(o(n))for(let l of Object.keys(n))(o(n[l])||Array.isArray(n[l]))&&(n[l]=s(n[l]));return n}return s(r.reuseInput?e:p(e))}return x(W);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.9.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
18
18
|
*/
|
|
19
|
-
/*! Bundled license information:
|
|
20
|
-
|
|
21
|
-
lodash-es/lodash.js:
|
|
22
|
-
(**
|
|
23
|
-
* @license
|
|
24
|
-
* Lodash (Custom Build) <https://lodash.com/>
|
|
25
|
-
* Build: `lodash modularize exports="es" -o ./`
|
|
26
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
27
|
-
* Released under MIT license <https://lodash.com/license>
|
|
28
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
29
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
30
|
-
*)
|
|
31
|
-
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "object-flatten-all-arrays",
|
|
3
|
-
"version": "7.1
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "Merge and flatten any arrays found in all values within plain objects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arrays",
|
|
@@ -35,46 +35,42 @@
|
|
|
35
35
|
},
|
|
36
36
|
"types": "types/index.d.ts",
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "node
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
38
|
+
"build": "node ../../ops/scripts/esbuild.js && npm run dts",
|
|
39
|
+
"coverage": "c8 uvu test",
|
|
40
|
+
"dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
|
|
42
41
|
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
43
|
-
"dts": "rollup -c &&
|
|
42
|
+
"dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
|
|
44
43
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
45
|
-
"lect": "node '../../ops/lect/lect.js'
|
|
46
|
-
"
|
|
47
|
-
"lint": "
|
|
44
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
45
|
+
"lect:check": "node '../../ops/lect/lect.js' --check",
|
|
46
|
+
"lint": "biome lint --error-on-warnings . && npm run typecheck",
|
|
47
|
+
"lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
|
|
48
48
|
"perf": "node perf/check.js",
|
|
49
49
|
"prep": "echo 'ready'",
|
|
50
|
-
"prettier": "
|
|
51
|
-
"prettier:format": "
|
|
52
|
-
"pretest": "npm run lect && npm run build",
|
|
50
|
+
"prettier": "biome format",
|
|
51
|
+
"prettier:format": "biome format --write .",
|
|
52
|
+
"pretest": "npm run lect:check && npm run build",
|
|
53
53
|
"test": "npm run devtest",
|
|
54
|
+
"typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
|
|
54
55
|
"unit": "uvu test"
|
|
55
56
|
},
|
|
56
|
-
"engines": {
|
|
57
|
-
"node": ">=14.18.0"
|
|
58
|
-
},
|
|
59
57
|
"c8": {
|
|
58
|
+
"all": true,
|
|
60
59
|
"check-coverage": true,
|
|
61
|
-
"exclude": [
|
|
62
|
-
|
|
63
|
-
],
|
|
60
|
+
"exclude": ["**/test/**/*.*"],
|
|
61
|
+
"include": ["dist/*.esm.js"],
|
|
64
62
|
"lines": 100
|
|
65
63
|
},
|
|
66
64
|
"lect": {
|
|
67
65
|
"licence": {
|
|
68
|
-
"extras": [
|
|
69
|
-
""
|
|
70
|
-
]
|
|
66
|
+
"extras": [""]
|
|
71
67
|
}
|
|
72
68
|
},
|
|
73
69
|
"dependencies": {
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
70
|
+
"codsen-utils": "^1.9.0"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=18.20.8"
|
|
78
74
|
},
|
|
79
75
|
"publishConfig": {
|
|
80
76
|
"registry": "https://registry.npmjs.org/"
|
package/types/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ interface Obj {
|
|
|
4
4
|
}
|
|
5
5
|
interface Opts {
|
|
6
6
|
flattenArraysContainingStringsToBeEmpty: boolean;
|
|
7
|
+
/** Reuse an exclusively owned input tree instead of cloning it. The input may be mutated. */
|
|
8
|
+
reuseInput?: boolean;
|
|
7
9
|
}
|
|
8
10
|
declare const defaults: Opts;
|
|
9
11
|
declare function flattenAllArrays(input: Obj, opts?: Partial<Opts>): Obj;
|