object-set-all-values-to 5.0.10 → 5.0.11

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,14 +26,12 @@
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, `4.1.0`.
30
30
 
31
31
  ```bash
32
32
  npm i object-set-all-values-to
33
33
  ```
34
34
 
35
- If you need a legacy version which works with `require`, use version 4.1.0
36
-
37
35
  ## Quick Take
38
36
 
39
37
  ```js
@@ -88,8 +86,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
88
86
 
89
87
  MIT License
90
88
 
91
- Copyright (c) 2010-2021 Roy Revelt and other contributors
92
-
89
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
93
90
 
94
91
  <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">
95
-
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name object-set-all-values-to
3
3
  * @fileoverview Recursively walk the input and set all found values in plain objects to something
4
- * @version 5.0.10
4
+ * @version 5.0.11
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/object-set-all-values-to/}
8
8
  */
9
9
 
10
- import a from"lodash.clonedeep";import l from"lodash.isplainobject";var n="5.0.10";var h=n;function i(c,r){let s,e=a(c);return arguments.length<2?s=!1:l(r)||Array.isArray(r)?s=a(r):s=r,Array.isArray(e)?e.forEach((t,o)=>{(l(e[o])||Array.isArray(e[o]))&&(e[o]=i(e[o],s))}):l(e)&&Object.keys(e).forEach(t=>{Array.isArray(e[t])||l(e[t])?e[t]=i(e[t],s):e[t]=s}),e}export{i as setAllValuesTo,h as version};
10
+ import i from"lodash.clonedeep";import n from"lodash.isplainobject";var l="5.0.11";var h=l;function a(c,r){let t,e=i(c);return arguments.length<2?t=!1:n(r)||Array.isArray(r)?t=i(r):t=r,Array.isArray(e)?e.forEach((s,o)=>{(n(e[o])||Array.isArray(e[o]))&&(e[o]=a(e[o],t))}):n(e)&&Object.keys(e).forEach(s=>{Array.isArray(e[s])||n(e[s])?e[s]=a(e[s],t):e[s]=t}),e}export{a as setAllValuesTo,h as version};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name object-set-all-values-to
3
3
  * @fileoverview Recursively walk the input and set all found values in plain objects to something
4
- * @version 5.0.10
4
+ * @version 5.0.11
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/object-set-all-values-to/}
8
8
  */
9
9
 
10
- var objectSetAllValuesTo=(()=>{var zt=Object.create;var T=Object.defineProperty;var kt=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var et=t=>T(t,"__esModule",{value:!0});var rt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ne=(t,e)=>{for(var r in e)T(t,r,{get:e[r],enumerable:!0})},nt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of te(e))!re.call(t,o)&&(r||o!=="default")&&T(t,o,{get:()=>e[o],enumerable:!(n=kt(e,o))||n.enumerable});return t},ot=(t,e)=>nt(et(T(t!=null?zt(ee(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),oe=(t=>(e,r)=>t&&t.get(e)||(r=nt(et({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var qt=rt((A,j)=>{var ae=200,at="__lodash_hash_undefined__",it=9007199254740991,B="[object Arguments]",ie="[object Array]",st="[object Boolean]",ct="[object Date]",se="[object Error]",H="[object Function]",ut="[object GeneratorFunction]",S="[object Map]",ft="[object Number]",L="[object Object]",lt="[object Promise]",pt="[object RegExp]",x="[object Set]",ht="[object String]",dt="[object Symbol]",D="[object WeakMap]",gt="[object ArrayBuffer]",C="[object DataView]",yt="[object Float32Array]",bt="[object Float64Array]",_t="[object Int8Array]",jt="[object Int16Array]",vt="[object Int32Array]",mt="[object Uint8Array]",At="[object Uint8ClampedArray]",wt="[object Uint16Array]",Ot="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,ue=/\w*$/,fe=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,a={};a[B]=a[ie]=a[gt]=a[C]=a[st]=a[ct]=a[yt]=a[bt]=a[_t]=a[jt]=a[vt]=a[S]=a[ft]=a[L]=a[pt]=a[x]=a[ht]=a[dt]=a[mt]=a[At]=a[wt]=a[Ot]=!0;a[se]=a[H]=a[D]=!1;var pe=typeof global=="object"&&global&&global.Object===Object&&global,he=typeof self=="object"&&self&&self.Object===Object&&self,u=pe||he||Function("return this")(),Tt=typeof A=="object"&&A&&!A.nodeType&&A,St=Tt&&typeof j=="object"&&j&&!j.nodeType&&j,de=St&&St.exports===Tt;function ge(t,e){return t.set(e[0],e[1]),t}function ye(t,e){return t.add(e),t}function be(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function _e(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function xt(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function je(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function ve(t,e){return t==null?void 0:t[e]}function Ct(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Et(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function F(t,e){return function(r){return t(e(r))}}function Pt(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var me=Array.prototype,Ae=Function.prototype,E=Object.prototype,U=u["__core-js_shared__"],It=function(){var t=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Mt=Ae.toString,l=E.hasOwnProperty,P=E.toString,we=RegExp("^"+Mt.call(l).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=de?u.Buffer:void 0,Gt=u.Symbol,Bt=u.Uint8Array,Oe=F(Object.getPrototypeOf,Object),Te=Object.create,Se=E.propertyIsEnumerable,xe=me.splice,Ht=Object.getOwnPropertySymbols,Ce=Rt?Rt.isBuffer:void 0,Ee=F(Object.keys,Object),$=_(u,"DataView"),v=_(u,"Map"),K=_(u,"Promise"),N=_(u,"Set"),V=_(u,"WeakMap"),m=_(Object,"create"),Pe=d($),Ie=d(v),Me=d(K),Re=d(N),Ge=d(V),Lt=Gt?Gt.prototype:void 0,Dt=Lt?Lt.valueOf:void 0;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 Be(){this.__data__=m?m(null):{}}function He(t){return this.has(t)&&delete this.__data__[t]}function Le(t){var e=this.__data__;if(m){var r=e[t];return r===at?void 0:r}return l.call(e,t)?e[t]:void 0}function De(t){var e=this.__data__;return m?e[t]!==void 0:l.call(e,t)}function Fe(t,e){var r=this.__data__;return r[t]=m&&e===void 0?at:e,this}p.prototype.clear=Be;p.prototype.delete=He;p.prototype.get=Le;p.prototype.has=De;p.prototype.set=Fe;function f(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 Ue(){this.__data__=[]}function $e(t){var e=this.__data__,r=I(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():xe.call(e,r,1),!0}function Ke(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]}function Ne(t){return I(this.__data__,t)>-1}function Ve(t,e){var r=this.__data__,n=I(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}f.prototype.clear=Ue;f.prototype.delete=$e;f.prototype.get=Ke;f.prototype.has=Ne;f.prototype.set=Ve;function y(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 We(){this.__data__={hash:new p,map:new(v||f),string:new p}}function qe(t){return M(this,t).delete(t)}function Je(t){return M(this,t).get(t)}function Xe(t){return M(this,t).has(t)}function Ye(t,e){return M(this,t).set(t,e),this}y.prototype.clear=We;y.prototype.delete=qe;y.prototype.get=Je;y.prototype.has=Xe;y.prototype.set=Ye;function b(t){this.__data__=new f(t)}function Ze(){this.__data__=new f}function Qe(t){return this.__data__.delete(t)}function ze(t){return this.__data__.get(t)}function ke(t){return this.__data__.has(t)}function tr(t,e){var r=this.__data__;if(r instanceof f){var n=r.__data__;if(!v||n.length<ae-1)return n.push([t,e]),this;r=this.__data__=new y(n)}return r.set(t,e),this}b.prototype.clear=Ze;b.prototype.delete=Qe;b.prototype.get=ze;b.prototype.has=ke;b.prototype.set=tr;function er(t,e){var r=J(t)||Tr(t)?je(t.length,String):[],n=r.length,o=!!n;for(var i in t)(e||l.call(t,i))&&!(o&&(i=="length"||mr(i,n)))&&r.push(i);return r}function Ft(t,e,r){var n=t[e];(!(l.call(t,e)&&Nt(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}function I(t,e){for(var r=t.length;r--;)if(Nt(t[r][0],e))return r;return-1}function rr(t,e){return t&&Ut(e,X(e),t)}function W(t,e,r,n,o,i,c){var s;if(n&&(s=i?n(t,o,i,c):n(t)),s!==void 0)return s;if(!R(t))return t;var Q=J(t);if(Q){if(s=_r(t),!e)return gr(t,s)}else{var g=h(t),z=g==H||g==ut;if(xr(t))return cr(t,e);if(g==L||g==B||z&&!i){if(Ct(t))return i?t:{};if(s=jr(z?{}:t),!e)return yr(t,rr(s,t))}else{if(!a[g])return i?t:{};s=vr(t,g,W,e)}}c||(c=new b);var k=c.get(t);if(k)return k;if(c.set(t,s),!Q)var tt=r?br(t):X(t);return be(tt||t,function(G,O){tt&&(O=G,G=t[O]),Ft(s,O,W(G,e,r,n,O,t,c))}),s}function nr(t){return R(t)?Te(t):{}}function or(t,e,r){var n=e(t);return J(t)?n:_e(n,r(t))}function ar(t){return P.call(t)}function ir(t){if(!R(t)||wr(t))return!1;var e=Wt(t)||Ct(t)?we:fe;return e.test(d(t))}function sr(t){if(!Kt(t))return Ee(t);var e=[];for(var r in Object(t))l.call(t,r)&&r!="constructor"&&e.push(r);return e}function cr(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function q(t){var e=new t.constructor(t.byteLength);return new Bt(e).set(new Bt(t)),e}function ur(t,e){var r=e?q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function fr(t,e,r){var n=e?r(Et(t),!0):Et(t);return xt(n,ge,new t.constructor)}function lr(t){var e=new t.constructor(t.source,ue.exec(t));return e.lastIndex=t.lastIndex,e}function pr(t,e,r){var n=e?r(Pt(t),!0):Pt(t);return xt(n,ye,new t.constructor)}function hr(t){return Dt?Object(Dt.call(t)):{}}function dr(t,e){var r=e?q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function gr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Ut(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var c=e[o],s=n?n(r[c],t[c],c,r,t):void 0;Ft(r,c,s===void 0?t[c]:s)}return r}function yr(t,e){return Ut(t,$t(t),e)}function br(t){return or(t,X,$t)}function M(t,e){var r=t.__data__;return Ar(e)?r[typeof e=="string"?"string":"hash"]:r.map}function _(t,e){var r=ve(t,e);return ir(r)?r:void 0}var $t=Ht?F(Ht,Object):Pr,h=ar;($&&h(new $(new ArrayBuffer(1)))!=C||v&&h(new v)!=S||K&&h(K.resolve())!=lt||N&&h(new N)!=x||V&&h(new V)!=D)&&(h=function(t){var e=P.call(t),r=e==L?t.constructor:void 0,n=r?d(r):void 0;if(n)switch(n){case Pe:return C;case Ie:return S;case Me:return lt;case Re:return x;case Ge:return D}return e});function _r(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&l.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function jr(t){return typeof t.constructor=="function"&&!Kt(t)?nr(Oe(t)):{}}function vr(t,e,r,n){var o=t.constructor;switch(e){case gt:return q(t);case st:case ct:return new o(+t);case C:return ur(t,n);case yt:case bt:case _t:case jt:case vt:case mt:case At:case wt:case Ot:return dr(t,n);case S:return fr(t,n,r);case ft:case ht:return new o(t);case pt:return lr(t);case x:return pr(t,n,r);case dt:return hr(t)}}function mr(t,e){return e=e==null?it:e,!!e&&(typeof t=="number"||le.test(t))&&t>-1&&t%1==0&&t<e}function Ar(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wr(t){return!!It&&It in t}function Kt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||E;return t===r}function d(t){if(t!=null){try{return Mt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Or(t){return W(t,!0,!0)}function Nt(t,e){return t===e||t!==t&&e!==e}function Tr(t){return Sr(t)&&l.call(t,"callee")&&(!Se.call(t,"callee")||P.call(t)==B)}var J=Array.isArray;function Vt(t){return t!=null&&Cr(t.length)&&!Wt(t)}function Sr(t){return Er(t)&&Vt(t)}var xr=Ce||Ir;function Wt(t){var e=R(t)?P.call(t):"";return e==H||e==ut}function Cr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=it}function R(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Er(t){return!!t&&typeof t=="object"}function X(t){return Vt(t)?er(t):sr(t)}function Pr(){return[]}function Ir(){return!1}j.exports=Or});var Zt=rt((qr,Yt)=>{var Mr="[object Object]";function Rr(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Gr(t,e){return function(r){return t(e(r))}}var Br=Function.prototype,Jt=Object.prototype,Xt=Br.toString,Hr=Jt.hasOwnProperty,Lr=Xt.call(Object),Dr=Jt.toString,Fr=Gr(Object.getPrototypeOf,Object);function Ur(t){return!!t&&typeof t=="object"}function $r(t){if(!Ur(t)||Dr.call(t)!=Mr||Rr(t))return!1;var e=Fr(t);if(e===null)return!0;var r=Hr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Xt.call(r)==Lr}Yt.exports=$r});var Vr={};ne(Vr,{setAllValuesTo:()=>Z,version:()=>Nr});var Y=ot(qt(),1),w=ot(Zt(),1);var Qt="5.0.10";var Nr=Qt;function Z(t,e){let r,n=(0,Y.default)(t);return arguments.length<2?r=!1:(0,w.default)(e)||Array.isArray(e)?r=(0,Y.default)(e):r=e,Array.isArray(n)?n.forEach((o,i)=>{((0,w.default)(n[i])||Array.isArray(n[i]))&&(n[i]=Z(n[i],r))}):(0,w.default)(n)&&Object.keys(n).forEach(o=>{Array.isArray(n[o])||(0,w.default)(n[o])?n[o]=Z(n[o],r):n[o]=r}),n}return oe(Vr);})();
10
+ var objectSetAllValuesTo=(()=>{var zt=Object.create;var T=Object.defineProperty;var kt=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var et=t=>T(t,"__esModule",{value:!0});var rt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ne=(t,e)=>{for(var r in e)T(t,r,{get:e[r],enumerable:!0})},nt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of te(e))!re.call(t,o)&&(r||o!=="default")&&T(t,o,{get:()=>e[o],enumerable:!(n=kt(e,o))||n.enumerable});return t},ot=(t,e)=>nt(et(T(t!=null?zt(ee(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),oe=(t=>(e,r)=>t&&t.get(e)||(r=nt(et({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var qt=rt((w,j)=>{var ae=200,at="__lodash_hash_undefined__",it=9007199254740991,B="[object Arguments]",ie="[object Array]",st="[object Boolean]",ct="[object Date]",se="[object Error]",H="[object Function]",ut="[object GeneratorFunction]",S="[object Map]",ft="[object Number]",L="[object Object]",lt="[object Promise]",pt="[object RegExp]",x="[object Set]",dt="[object String]",ht="[object Symbol]",D="[object WeakMap]",gt="[object ArrayBuffer]",C="[object DataView]",yt="[object Float32Array]",bt="[object Float64Array]",_t="[object Int8Array]",jt="[object Int16Array]",vt="[object Int32Array]",mt="[object Uint8Array]",wt="[object Uint8ClampedArray]",At="[object Uint16Array]",Ot="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,ue=/\w*$/,fe=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,a={};a[B]=a[ie]=a[gt]=a[C]=a[st]=a[ct]=a[yt]=a[bt]=a[_t]=a[jt]=a[vt]=a[S]=a[ft]=a[L]=a[pt]=a[x]=a[dt]=a[ht]=a[mt]=a[wt]=a[At]=a[Ot]=!0;a[se]=a[H]=a[D]=!1;var pe=typeof global=="object"&&global&&global.Object===Object&&global,de=typeof self=="object"&&self&&self.Object===Object&&self,u=pe||de||Function("return this")(),Tt=typeof w=="object"&&w&&!w.nodeType&&w,St=Tt&&typeof j=="object"&&j&&!j.nodeType&&j,he=St&&St.exports===Tt;function ge(t,e){return t.set(e[0],e[1]),t}function ye(t,e){return t.add(e),t}function be(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function _e(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function xt(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function je(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function ve(t,e){return t==null?void 0:t[e]}function Ct(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Et(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function F(t,e){return function(r){return t(e(r))}}function Pt(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var me=Array.prototype,we=Function.prototype,E=Object.prototype,U=u["__core-js_shared__"],It=function(){var t=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Mt=we.toString,l=E.hasOwnProperty,P=E.toString,Ae=RegExp("^"+Mt.call(l).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=he?u.Buffer:void 0,Gt=u.Symbol,Bt=u.Uint8Array,Oe=F(Object.getPrototypeOf,Object),Te=Object.create,Se=E.propertyIsEnumerable,xe=me.splice,Ht=Object.getOwnPropertySymbols,Ce=Rt?Rt.isBuffer:void 0,Ee=F(Object.keys,Object),$=_(u,"DataView"),v=_(u,"Map"),K=_(u,"Promise"),N=_(u,"Set"),V=_(u,"WeakMap"),m=_(Object,"create"),Pe=h($),Ie=h(v),Me=h(K),Re=h(N),Ge=h(V),Lt=Gt?Gt.prototype:void 0,Dt=Lt?Lt.valueOf:void 0;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 Be(){this.__data__=m?m(null):{}}function He(t){return this.has(t)&&delete this.__data__[t]}function Le(t){var e=this.__data__;if(m){var r=e[t];return r===at?void 0:r}return l.call(e,t)?e[t]:void 0}function De(t){var e=this.__data__;return m?e[t]!==void 0:l.call(e,t)}function Fe(t,e){var r=this.__data__;return r[t]=m&&e===void 0?at:e,this}p.prototype.clear=Be;p.prototype.delete=He;p.prototype.get=Le;p.prototype.has=De;p.prototype.set=Fe;function f(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 Ue(){this.__data__=[]}function $e(t){var e=this.__data__,r=I(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():xe.call(e,r,1),!0}function Ke(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]}function Ne(t){return I(this.__data__,t)>-1}function Ve(t,e){var r=this.__data__,n=I(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}f.prototype.clear=Ue;f.prototype.delete=$e;f.prototype.get=Ke;f.prototype.has=Ne;f.prototype.set=Ve;function y(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 We(){this.__data__={hash:new p,map:new(v||f),string:new p}}function qe(t){return M(this,t).delete(t)}function Je(t){return M(this,t).get(t)}function Xe(t){return M(this,t).has(t)}function Ye(t,e){return M(this,t).set(t,e),this}y.prototype.clear=We;y.prototype.delete=qe;y.prototype.get=Je;y.prototype.has=Xe;y.prototype.set=Ye;function b(t){this.__data__=new f(t)}function Ze(){this.__data__=new f}function Qe(t){return this.__data__.delete(t)}function ze(t){return this.__data__.get(t)}function ke(t){return this.__data__.has(t)}function tr(t,e){var r=this.__data__;if(r instanceof f){var n=r.__data__;if(!v||n.length<ae-1)return n.push([t,e]),this;r=this.__data__=new y(n)}return r.set(t,e),this}b.prototype.clear=Ze;b.prototype.delete=Qe;b.prototype.get=ze;b.prototype.has=ke;b.prototype.set=tr;function er(t,e){var r=J(t)||Tr(t)?je(t.length,String):[],n=r.length,o=!!n;for(var i in t)(e||l.call(t,i))&&!(o&&(i=="length"||mr(i,n)))&&r.push(i);return r}function Ft(t,e,r){var n=t[e];(!(l.call(t,e)&&Nt(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}function I(t,e){for(var r=t.length;r--;)if(Nt(t[r][0],e))return r;return-1}function rr(t,e){return t&&Ut(e,X(e),t)}function W(t,e,r,n,o,i,c){var s;if(n&&(s=i?n(t,o,i,c):n(t)),s!==void 0)return s;if(!R(t))return t;var Q=J(t);if(Q){if(s=_r(t),!e)return gr(t,s)}else{var g=d(t),z=g==H||g==ut;if(xr(t))return cr(t,e);if(g==L||g==B||z&&!i){if(Ct(t))return i?t:{};if(s=jr(z?{}:t),!e)return yr(t,rr(s,t))}else{if(!a[g])return i?t:{};s=vr(t,g,W,e)}}c||(c=new b);var k=c.get(t);if(k)return k;if(c.set(t,s),!Q)var tt=r?br(t):X(t);return be(tt||t,function(G,O){tt&&(O=G,G=t[O]),Ft(s,O,W(G,e,r,n,O,t,c))}),s}function nr(t){return R(t)?Te(t):{}}function or(t,e,r){var n=e(t);return J(t)?n:_e(n,r(t))}function ar(t){return P.call(t)}function ir(t){if(!R(t)||Ar(t))return!1;var e=Wt(t)||Ct(t)?Ae:fe;return e.test(h(t))}function sr(t){if(!Kt(t))return Ee(t);var e=[];for(var r in Object(t))l.call(t,r)&&r!="constructor"&&e.push(r);return e}function cr(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function q(t){var e=new t.constructor(t.byteLength);return new Bt(e).set(new Bt(t)),e}function ur(t,e){var r=e?q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function fr(t,e,r){var n=e?r(Et(t),!0):Et(t);return xt(n,ge,new t.constructor)}function lr(t){var e=new t.constructor(t.source,ue.exec(t));return e.lastIndex=t.lastIndex,e}function pr(t,e,r){var n=e?r(Pt(t),!0):Pt(t);return xt(n,ye,new t.constructor)}function dr(t){return Dt?Object(Dt.call(t)):{}}function hr(t,e){var r=e?q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function gr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Ut(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var c=e[o],s=n?n(r[c],t[c],c,r,t):void 0;Ft(r,c,s===void 0?t[c]:s)}return r}function yr(t,e){return Ut(t,$t(t),e)}function br(t){return or(t,X,$t)}function M(t,e){var r=t.__data__;return wr(e)?r[typeof e=="string"?"string":"hash"]:r.map}function _(t,e){var r=ve(t,e);return ir(r)?r:void 0}var $t=Ht?F(Ht,Object):Pr,d=ar;($&&d(new $(new ArrayBuffer(1)))!=C||v&&d(new v)!=S||K&&d(K.resolve())!=lt||N&&d(new N)!=x||V&&d(new V)!=D)&&(d=function(t){var e=P.call(t),r=e==L?t.constructor:void 0,n=r?h(r):void 0;if(n)switch(n){case Pe:return C;case Ie:return S;case Me:return lt;case Re:return x;case Ge:return D}return e});function _r(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&l.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function jr(t){return typeof t.constructor=="function"&&!Kt(t)?nr(Oe(t)):{}}function vr(t,e,r,n){var o=t.constructor;switch(e){case gt:return q(t);case st:case ct:return new o(+t);case C:return ur(t,n);case yt:case bt:case _t:case jt:case vt:case mt:case wt:case At:case Ot:return hr(t,n);case S:return fr(t,n,r);case ft:case dt:return new o(t);case pt:return lr(t);case x:return pr(t,n,r);case ht:return dr(t)}}function mr(t,e){return e=e==null?it:e,!!e&&(typeof t=="number"||le.test(t))&&t>-1&&t%1==0&&t<e}function wr(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ar(t){return!!It&&It in t}function Kt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||E;return t===r}function h(t){if(t!=null){try{return Mt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Or(t){return W(t,!0,!0)}function Nt(t,e){return t===e||t!==t&&e!==e}function Tr(t){return Sr(t)&&l.call(t,"callee")&&(!Se.call(t,"callee")||P.call(t)==B)}var J=Array.isArray;function Vt(t){return t!=null&&Cr(t.length)&&!Wt(t)}function Sr(t){return Er(t)&&Vt(t)}var xr=Ce||Ir;function Wt(t){var e=R(t)?P.call(t):"";return e==H||e==ut}function Cr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=it}function R(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Er(t){return!!t&&typeof t=="object"}function X(t){return Vt(t)?er(t):sr(t)}function Pr(){return[]}function Ir(){return!1}j.exports=Or});var Zt=rt((qr,Yt)=>{var Mr="[object Object]";function Rr(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Gr(t,e){return function(r){return t(e(r))}}var Br=Function.prototype,Jt=Object.prototype,Xt=Br.toString,Hr=Jt.hasOwnProperty,Lr=Xt.call(Object),Dr=Jt.toString,Fr=Gr(Object.getPrototypeOf,Object);function Ur(t){return!!t&&typeof t=="object"}function $r(t){if(!Ur(t)||Dr.call(t)!=Mr||Rr(t))return!1;var e=Fr(t);if(e===null)return!0;var r=Hr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Xt.call(r)==Lr}Yt.exports=$r});var Vr={};ne(Vr,{setAllValuesTo:()=>Z,version:()=>Nr});var Y=ot(qt(),1),A=ot(Zt(),1);var Qt="5.0.11";var Nr=Qt;function Z(t,e){let r,n=(0,Y.default)(t);return arguments.length<2?r=!1:(0,A.default)(e)||Array.isArray(e)?r=(0,Y.default)(e):r=e,Array.isArray(n)?n.forEach((o,i)=>{((0,A.default)(n[i])||Array.isArray(n[i]))&&(n[i]=Z(n[i],r))}):(0,A.default)(n)&&Object.keys(n).forEach(o=>{Array.isArray(n[o])||(0,A.default)(n[o])?n[o]=Z(n[o],r):n[o]=r}),n}return oe(Vr);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "object-set-all-values-to",
3
- "version": "5.0.10",
3
+ "version": "5.0.11",
4
4
  "description": "Recursively walk the input and set all found values in plain objects to something",
5
5
  "keywords": [
6
6
  "all",
@@ -36,13 +36,15 @@
36
36
  "scripts": {
37
37
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
38
38
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
39
- "dts": "rollup -c",
39
+ "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
40
40
  "examples": "node '../../ops/scripts/run-examples.js'",
41
41
  "lect": "node '../../ops/lect/lect.js'",
42
42
  "letspublish": "yarn publish || :",
43
43
  "lint": "eslint . --fix",
44
44
  "perf": "node perf/check.js",
45
45
  "prepare": "echo 'ready'",
46
+ "prettier": "prettier",
47
+ "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
46
48
  "pretest": "yarn run lect && yarn run build",
47
49
  "test": "c8 yarn run unit && yarn run examples && yarn run lint",
48
50
  "unit": "uvu test"
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare const version: string;
2
2
  interface Obj {
3
- [key: string]: any;
3
+ [key: string]: any;
4
4
  }
5
5
  declare function setAllValuesTo(inputOriginal: Obj, valueOriginal?: any): Obj;
6
6