object-boolean-combinations 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-
|
|
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
|
-
|
|
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-boolean-combinations
|
|
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
|
|
@@ -73,8 +71,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
73
71
|
|
|
74
72
|
MIT License
|
|
75
73
|
|
|
76
|
-
Copyright (c) 2010-
|
|
77
|
-
|
|
74
|
+
Copyright (c) 2010-2022 Roy Revelt and other contributors
|
|
78
75
|
|
|
79
76
|
<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">
|
|
80
|
-
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-boolean-combinations
|
|
3
3
|
* @fileoverview Consumes a defaults object with booleans, generates all possible variations of it
|
|
4
|
-
* @version 5.0.
|
|
4
|
+
* @version 5.0.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-boolean-combinations/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import O from"lodash.intersection";import k from"lodash.pull";import r from"lodash.isplainobject";import j from"lodash.clonedeep";var h="5.0.
|
|
10
|
+
import O from"lodash.intersection";import k from"lodash.pull";import r from"lodash.isplainobject";import j from"lodash.clonedeep";var h="5.0.11";var _=h;function T(i,c={}){function y(e){let t=[];for(let s=0;s<1<<e;s++){let n=[];for(let b=0;b<e;b++)n.push(s&1<<b?1:0);t.push(n)}return t}if(!i)throw new Error("[THROW_ID_01] missing input object");if(!r(i))throw new Error("[THROW_ID_02] the first input object must be a true object");if(c&&!r(c))throw new Error("[THROW_ID_03] the second override object must be a true object");let d=j(i),o=j(c),l=Object.keys(d),a=[],p=[];r(o)&&Object.keys(o).length&&(p=O(Object.keys(o),Object.keys(d)),p.forEach(e=>k(l,e)));let m=y(Object.keys(l).length),u;return m.forEach((e,t)=>{u={},l.forEach((s,n)=>{u[s]=m[t][n]===1}),a.push(u)}),r(o)&&Object.keys(o).length&&a.forEach(e=>{p.forEach(t=>{e[t]=o[t]})}),a}export{T as combinations,_ as version};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-boolean-combinations
|
|
3
3
|
* @fileoverview Consumes a defaults object with booleans, generates all possible variations of it
|
|
4
|
-
* @version 5.0.
|
|
4
|
+
* @version 5.0.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-boolean-combinations/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var objectBooleanCombinations=(()=>{var Se=Object.create;var D=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Ee=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty;var pt=t=>D(t,"__esModule",{value:!0});var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pe=(t,e)=>{for(var n in e)D(t,n,{get:e[n],enumerable:!0})},dt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Te(e))!Ie.call(t,o)&&(n||o!=="default")&&D(t,o,{get:()=>e[o],enumerable:!(r=Ae(e,o))||r.enumerable});return t},F=(t,e)=>dt(pt(D(t!=null?Se(Ee(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Me=(t=>(e,n)=>t&&t.get(e)||(n=dt(pt({}),e,1),t&&t.set(e,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var St=R((Ro,Ct)=>{var J="__lodash_hash_undefined__",He=9007199254740991,De="[object Function]",Re="[object GeneratorFunction]",Fe=/[\\^$.*+?()[\]{}|]/g,Le=/^\[object .+?Constructor\]$/,Ge=typeof global=="object"&&global&&global.Object===Object&&global,Ne=typeof self=="object"&&self&&self.Object===Object&&self,gt=Ge||Ne||Function("return this")();function Be(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ue(t,e){var n=t?t.length:0;return!!n&&Ke(t,e,0)>-1}function $e(t,e,n){for(var r=-1,o=t?t.length:0;++r<o;)if(n(e,t[r]))return!0;return!1}function bt(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Ve(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Ke(t,e,n){if(e!==e)return Ve(t,We,n);for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}function We(t){return t!==t}function ke(t){return function(e){return t(e)}}function _t(t,e){return t.has(e)}function qe(t,e){return t==null?void 0:t[e]}function Je(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(n){}return e}var Xe=Array.prototype,Ye=Function.prototype,yt=Object.prototype,X=gt["__core-js_shared__"],jt=function(){var t=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),vt=Ye.toString,Y=yt.hasOwnProperty,Ze=yt.toString,Qe=RegExp("^"+vt.call(Y).replace(Fe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=Xe.splice,wt=Math.max,tn=Math.min,en=Ot(gt,"Map"),E=Ot(Object,"create");function j(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function nn(){this.__data__=E?E(null):{}}function rn(t){return this.has(t)&&delete this.__data__[t]}function on(t){var e=this.__data__;if(E){var n=e[t];return n===J?void 0:n}return Y.call(e,t)?e[t]:void 0}function an(t){var e=this.__data__;return E?e[t]!==void 0:Y.call(e,t)}function cn(t,e){var n=this.__data__;return n[t]=E&&e===void 0?J:e,this}j.prototype.clear=nn;j.prototype.delete=rn;j.prototype.get=on;j.prototype.has=an;j.prototype.set=cn;function x(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function sn(){this.__data__=[]}function un(t){var e=this.__data__,n=G(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ze.call(e,n,1),!0}function ln(t){var e=this.__data__,n=G(e,t);return n<0?void 0:e[n][1]}function fn(t){return G(this.__data__,t)>-1}function hn(t,e){var n=this.__data__,r=G(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}x.prototype.clear=sn;x.prototype.delete=un;x.prototype.get=ln;x.prototype.has=fn;x.prototype.set=hn;function m(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function pn(){this.__data__={hash:new j,map:new(en||x),string:new j}}function dn(t){return N(this,t).delete(t)}function gn(t){return N(this,t).get(t)}function bn(t){return N(this,t).has(t)}function _n(t,e){return N(this,t).set(t,e),this}m.prototype.clear=pn;m.prototype.delete=dn;m.prototype.get=gn;m.prototype.has=bn;m.prototype.set=_n;function L(t){var e=-1,n=t?t.length:0;for(this.__data__=new m;++e<n;)this.add(t[e])}function yn(t){return this.__data__.set(t,J),this}function jn(t){return this.__data__.has(t)}L.prototype.add=L.prototype.push=yn;L.prototype.has=jn;function G(t,e){for(var n=t.length;n--;)if(Tn(t[n][0],e))return n;return-1}function vn(t,e,n){for(var r=n?$e:Ue,o=t[0].length,i=t.length,a=i,c=Array(i),h=1/0,l=[];a--;){var u=t[a];a&&e&&(u=bt(u,ke(e))),h=tn(u.length,h),c[a]=!n&&(e||o>=120&&u.length>=120)?new L(a&&u):void 0}u=t[0];var d=-1,g=c[0];t:for(;++d<o&&l.length<h;){var f=u[d],p=e?e(f):f;if(f=n||f!==0?f:0,!(g?_t(g,p):r(l,p,n))){for(a=i;--a;){var ht=c[a];if(!(ht?_t(ht,p):r(t[a],p,n)))continue t}g&&g.push(p),l.push(f)}}return l}function wn(t){if(!mt(t)||Cn(t))return!1;var e=xt(t)||Je(t)?Qe:Le;return e.test(Sn(t))}function On(t,e){return e=wt(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,o=wt(n.length-e,0),i=Array(o);++r<o;)i[r]=n[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=n[r];return a[e]=i,Be(t,this,a)}}function xn(t){return In(t)?t:[]}function N(t,e){var n=t.__data__;return mn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Ot(t,e){var n=qe(t,e);return wn(n)?n:void 0}function mn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Cn(t){return!!jt&&jt in t}function Sn(t){if(t!=null){try{return vt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var An=On(function(t){var e=bt(t,xn);return e.length&&e[0]===t[0]?vn(e):[]});function Tn(t,e){return t===e||t!==t&&e!==e}function En(t){return t!=null&&Pn(t.length)&&!xt(t)}function In(t){return Mn(t)&&En(t)}function xt(t){var e=mt(t)?Ze.call(t):"";return e==De||e==Re}function Pn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=He}function mt(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Mn(t){return!!t&&typeof t=="object"}Ct.exports=An});var It=R((Fo,Et)=>{function Hn(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Dn(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Rn(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Fn(t,e,n){if(e!==e)return Rn(t,Gn,n);for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}function Ln(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Gn(t){return t!==t}function Nn(t){return function(e){return t(e)}}var Bn=Array.prototype,At=Bn.splice,Tt=Math.max;function Un(t,e,n,r){var o=r?Ln:Fn,i=-1,a=e.length,c=t;for(t===e&&(e=Vn(e)),n&&(c=Dn(t,Nn(n)));++i<a;)for(var h=0,l=e[i],u=n?n(l):l;(h=o(c,u,h,r))>-1;)c!==t&&At.call(c,h,1),At.call(t,h,1);return t}function $n(t,e){return e=Tt(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,o=Tt(n.length-e,0),i=Array(o);++r<o;)i[r]=n[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=n[r];return a[e]=i,Hn(t,this,a)}}function Vn(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var Kn=$n(Wn);function Wn(t,e){return t&&t.length&&e&&e.length?Un(t,e):t}Et.exports=Kn});var Dt=R((Lo,Ht)=>{var kn="[object Object]";function qn(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(n){}return e}function Jn(t,e){return function(n){return t(e(n))}}var Xn=Function.prototype,Pt=Object.prototype,Mt=Xn.toString,Yn=Pt.hasOwnProperty,Zn=Mt.call(Object),Qn=Pt.toString,zn=Jn(Object.getPrototypeOf,Object);function tr(t){return!!t&&typeof t=="object"}function er(t){if(!tr(t)||Qn.call(t)!=kn||qn(t))return!1;var e=zn(t);if(e===null)return!0;var n=Yn.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Mt.call(n)==Zn}Ht.exports=er});var Oe=R((M,T)=>{var nr=200,Rt="__lodash_hash_undefined__",Ft=9007199254740991,Z="[object Arguments]",rr="[object Array]",Lt="[object Boolean]",Gt="[object Date]",or="[object Error]",Q="[object Function]",Nt="[object GeneratorFunction]",B="[object Map]",Bt="[object Number]",z="[object Object]",Ut="[object Promise]",$t="[object RegExp]",U="[object Set]",Vt="[object String]",Kt="[object Symbol]",tt="[object WeakMap]",Wt="[object ArrayBuffer]",$="[object DataView]",kt="[object Float32Array]",qt="[object Float64Array]",Jt="[object Int8Array]",Xt="[object Int16Array]",Yt="[object Int32Array]",Zt="[object Uint8Array]",Qt="[object Uint8ClampedArray]",zt="[object Uint16Array]",te="[object Uint32Array]",ir=/[\\^$.*+?()[\]{}|]/g,ar=/\w*$/,cr=/^\[object .+?Constructor\]$/,sr=/^(?:0|[1-9]\d*)$/,s={};s[Z]=s[rr]=s[Wt]=s[$]=s[Lt]=s[Gt]=s[kt]=s[qt]=s[Jt]=s[Xt]=s[Yt]=s[B]=s[Bt]=s[z]=s[$t]=s[U]=s[Vt]=s[Kt]=s[Zt]=s[Qt]=s[zt]=s[te]=!0;s[or]=s[Q]=s[tt]=!1;var ur=typeof global=="object"&&global&&global.Object===Object&&global,lr=typeof self=="object"&&self&&self.Object===Object&&self,b=ur||lr||Function("return this")(),ee=typeof M=="object"&&M&&!M.nodeType&&M,ne=ee&&typeof T=="object"&&T&&!T.nodeType&&T,fr=ne&&ne.exports===ee;function hr(t,e){return t.set(e[0],e[1]),t}function pr(t,e){return t.add(e),t}function dr(t,e){for(var n=-1,r=t?t.length:0;++n<r&&e(t[n],n,t)!==!1;);return t}function gr(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function re(t,e,n,r){var o=-1,i=t?t.length:0;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function br(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function _r(t,e){return t==null?void 0:t[e]}function oe(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(n){}return e}function ie(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}function et(t,e){return function(n){return t(e(n))}}function ae(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var yr=Array.prototype,jr=Function.prototype,V=Object.prototype,nt=b["__core-js_shared__"],ce=function(){var t=/[^.]+$/.exec(nt&&nt.keys&&nt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),se=jr.toString,y=V.hasOwnProperty,K=V.toString,vr=RegExp("^"+se.call(y).replace(ir,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ue=fr?b.Buffer:void 0,le=b.Symbol,fe=b.Uint8Array,wr=et(Object.getPrototypeOf,Object),Or=Object.create,xr=V.propertyIsEnumerable,mr=yr.splice,he=Object.getOwnPropertySymbols,Cr=ue?ue.isBuffer:void 0,Sr=et(Object.keys,Object),rt=A(b,"DataView"),I=A(b,"Map"),ot=A(b,"Promise"),it=A(b,"Set"),at=A(b,"WeakMap"),P=A(Object,"create"),Ar=O(rt),Tr=O(I),Er=O(ot),Ir=O(it),Pr=O(at),pe=le?le.prototype:void 0,de=pe?pe.valueOf:void 0;function v(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Mr(){this.__data__=P?P(null):{}}function Hr(t){return this.has(t)&&delete this.__data__[t]}function Dr(t){var e=this.__data__;if(P){var n=e[t];return n===Rt?void 0:n}return y.call(e,t)?e[t]:void 0}function Rr(t){var e=this.__data__;return P?e[t]!==void 0:y.call(e,t)}function Fr(t,e){var n=this.__data__;return n[t]=P&&e===void 0?Rt:e,this}v.prototype.clear=Mr;v.prototype.delete=Hr;v.prototype.get=Dr;v.prototype.has=Rr;v.prototype.set=Fr;function _(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Lr(){this.__data__=[]}function Gr(t){var e=this.__data__,n=W(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():mr.call(e,n,1),!0}function Nr(t){var e=this.__data__,n=W(e,t);return n<0?void 0:e[n][1]}function Br(t){return W(this.__data__,t)>-1}function Ur(t,e){var n=this.__data__,r=W(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}_.prototype.clear=Lr;_.prototype.delete=Gr;_.prototype.get=Nr;_.prototype.has=Br;_.prototype.set=Ur;function C(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function $r(){this.__data__={hash:new v,map:new(I||_),string:new v}}function Vr(t){return k(this,t).delete(t)}function Kr(t){return k(this,t).get(t)}function Wr(t){return k(this,t).has(t)}function kr(t,e){return k(this,t).set(t,e),this}C.prototype.clear=$r;C.prototype.delete=Vr;C.prototype.get=Kr;C.prototype.has=Wr;C.prototype.set=kr;function S(t){this.__data__=new _(t)}function qr(){this.__data__=new _}function Jr(t){return this.__data__.delete(t)}function Xr(t){return this.__data__.get(t)}function Yr(t){return this.__data__.has(t)}function Zr(t,e){var n=this.__data__;if(n instanceof _){var r=n.__data__;if(!I||r.length<nr-1)return r.push([t,e]),this;n=this.__data__=new C(r)}return n.set(t,e),this}S.prototype.clear=qr;S.prototype.delete=Jr;S.prototype.get=Xr;S.prototype.has=Yr;S.prototype.set=Zr;function Qr(t,e){var n=ut(t)||xo(t)?br(t.length,String):[],r=n.length,o=!!r;for(var i in t)(e||y.call(t,i))&&!(o&&(i=="length"||jo(i,r)))&&n.push(i);return n}function ge(t,e,n){var r=t[e];(!(y.call(t,e)&&je(r,n))||n===void 0&&!(e in t))&&(t[e]=n)}function W(t,e){for(var n=t.length;n--;)if(je(t[n][0],e))return n;return-1}function zr(t,e){return t&&be(e,lt(e),t)}function ct(t,e,n,r,o,i,a){var c;if(r&&(c=i?r(t,o,i,a):r(t)),c!==void 0)return c;if(!q(t))return t;var h=ut(t);if(h){if(c=bo(t),!e)return ho(t,c)}else{var l=w(t),u=l==Q||l==Nt;if(Co(t))return io(t,e);if(l==z||l==Z||u&&!i){if(oe(t))return i?t:{};if(c=_o(u?{}:t),!e)return po(t,zr(c,t))}else{if(!s[l])return i?t:{};c=yo(t,l,ct,e)}}a||(a=new S);var d=a.get(t);if(d)return d;if(a.set(t,c),!h)var g=n?go(t):lt(t);return dr(g||t,function(f,p){g&&(p=f,f=t[p]),ge(c,p,ct(f,e,n,r,p,t,a))}),c}function to(t){return q(t)?Or(t):{}}function eo(t,e,n){var r=e(t);return ut(t)?r:gr(r,n(t))}function no(t){return K.call(t)}function ro(t){if(!q(t)||wo(t))return!1;var e=we(t)||oe(t)?vr:cr;return e.test(O(t))}function oo(t){if(!ye(t))return Sr(t);var e=[];for(var n in Object(t))y.call(t,n)&&n!="constructor"&&e.push(n);return e}function io(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}function st(t){var e=new t.constructor(t.byteLength);return new fe(e).set(new fe(t)),e}function ao(t,e){var n=e?st(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function co(t,e,n){var r=e?n(ie(t),!0):ie(t);return re(r,hr,new t.constructor)}function so(t){var e=new t.constructor(t.source,ar.exec(t));return e.lastIndex=t.lastIndex,e}function uo(t,e,n){var r=e?n(ae(t),!0):ae(t);return re(r,pr,new t.constructor)}function lo(t){return de?Object(de.call(t)):{}}function fo(t,e){var n=e?st(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ho(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function be(t,e,n,r){n||(n={});for(var o=-1,i=e.length;++o<i;){var a=e[o],c=r?r(n[a],t[a],a,n,t):void 0;ge(n,a,c===void 0?t[a]:c)}return n}function po(t,e){return be(t,_e(t),e)}function go(t){return eo(t,lt,_e)}function k(t,e){var n=t.__data__;return vo(e)?n[typeof e=="string"?"string":"hash"]:n.map}function A(t,e){var n=_r(t,e);return ro(n)?n:void 0}var _e=he?et(he,Object):To,w=no;(rt&&w(new rt(new ArrayBuffer(1)))!=$||I&&w(new I)!=B||ot&&w(ot.resolve())!=Ut||it&&w(new it)!=U||at&&w(new at)!=tt)&&(w=function(t){var e=K.call(t),n=e==z?t.constructor:void 0,r=n?O(n):void 0;if(r)switch(r){case Ar:return $;case Tr:return B;case Er:return Ut;case Ir:return U;case Pr:return tt}return e});function bo(t){var e=t.length,n=t.constructor(e);return e&&typeof t[0]=="string"&&y.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function _o(t){return typeof t.constructor=="function"&&!ye(t)?to(wr(t)):{}}function yo(t,e,n,r){var o=t.constructor;switch(e){case Wt:return st(t);case Lt:case Gt:return new o(+t);case $:return ao(t,r);case kt:case qt:case Jt:case Xt:case Yt:case Zt:case Qt:case zt:case te:return fo(t,r);case B:return co(t,r,n);case Bt:case Vt:return new o(t);case $t:return so(t);case U:return uo(t,r,n);case Kt:return lo(t)}}function jo(t,e){return e=e==null?Ft:e,!!e&&(typeof t=="number"||sr.test(t))&&t>-1&&t%1==0&&t<e}function vo(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wo(t){return!!ce&&ce in t}function ye(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||V;return t===n}function O(t){if(t!=null){try{return se.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Oo(t){return ct(t,!0,!0)}function je(t,e){return t===e||t!==t&&e!==e}function xo(t){return mo(t)&&y.call(t,"callee")&&(!xr.call(t,"callee")||K.call(t)==Z)}var ut=Array.isArray;function ve(t){return t!=null&&So(t.length)&&!we(t)}function mo(t){return Ao(t)&&ve(t)}var Co=Cr||Eo;function we(t){var e=q(t)?K.call(t):"";return e==Q||e==Nt}function So(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ft}function q(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ao(t){return!!t&&typeof t=="object"}function lt(t){return ve(t)?Qr(t):oo(t)}function To(){return[]}function Eo(){return!1}T.exports=Oo});var Ho={};Pe(Ho,{combinations:()=>Mo,version:()=>Po});var me=F(St(),1),Ce=F(It(),1),H=F(Dt(),1),ft=F(Oe(),1);var xe="5.0.10";var Po=xe;function Mo(t,e={}){function n(u){let d=[];for(let g=0;g<1<<u;g++){let f=[];for(let p=0;p<u;p++)f.push(g&1<<p?1:0);d.push(f)}return d}if(!t)throw new Error("[THROW_ID_01] missing input object");if(!(0,H.default)(t))throw new Error("[THROW_ID_02] the first input object must be a true object");if(e&&!(0,H.default)(e))throw new Error("[THROW_ID_03] the second override object must be a true object");let r=(0,ft.default)(t),o=(0,ft.default)(e),i=Object.keys(r),a=[],c=[];(0,H.default)(o)&&Object.keys(o).length&&(c=(0,me.default)(Object.keys(o),Object.keys(r)),c.forEach(u=>(0,Ce.default)(i,u)));let h=n(Object.keys(i).length),l;return h.forEach((u,d)=>{l={},i.forEach((g,f)=>{l[g]=h[d][f]===1}),a.push(l)}),(0,H.default)(o)&&Object.keys(o).length&&a.forEach(u=>{c.forEach(d=>{u[d]=o[d]})}),a}return Me(Ho);})();
|
|
10
|
+
var objectBooleanCombinations=(()=>{var Se=Object.create;var D=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Ee=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty;var pt=t=>D(t,"__esModule",{value:!0});var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pe=(t,e)=>{for(var n in e)D(t,n,{get:e[n],enumerable:!0})},dt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Te(e))!Ie.call(t,o)&&(n||o!=="default")&&D(t,o,{get:()=>e[o],enumerable:!(r=Ae(e,o))||r.enumerable});return t},F=(t,e)=>dt(pt(D(t!=null?Se(Ee(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Me=(t=>(e,n)=>t&&t.get(e)||(n=dt(pt({}),e,1),t&&t.set(e,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var St=R((Ro,Ct)=>{var J="__lodash_hash_undefined__",He=9007199254740991,De="[object Function]",Re="[object GeneratorFunction]",Fe=/[\\^$.*+?()[\]{}|]/g,Le=/^\[object .+?Constructor\]$/,Ge=typeof global=="object"&&global&&global.Object===Object&&global,Ne=typeof self=="object"&&self&&self.Object===Object&&self,gt=Ge||Ne||Function("return this")();function Be(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ue(t,e){var n=t?t.length:0;return!!n&&Ke(t,e,0)>-1}function $e(t,e,n){for(var r=-1,o=t?t.length:0;++r<o;)if(n(e,t[r]))return!0;return!1}function bt(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Ve(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Ke(t,e,n){if(e!==e)return Ve(t,We,n);for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}function We(t){return t!==t}function ke(t){return function(e){return t(e)}}function _t(t,e){return t.has(e)}function qe(t,e){return t==null?void 0:t[e]}function Je(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(n){}return e}var Xe=Array.prototype,Ye=Function.prototype,yt=Object.prototype,X=gt["__core-js_shared__"],jt=function(){var t=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),vt=Ye.toString,Y=yt.hasOwnProperty,Ze=yt.toString,Qe=RegExp("^"+vt.call(Y).replace(Fe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=Xe.splice,wt=Math.max,tn=Math.min,en=Ot(gt,"Map"),E=Ot(Object,"create");function j(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function nn(){this.__data__=E?E(null):{}}function rn(t){return this.has(t)&&delete this.__data__[t]}function on(t){var e=this.__data__;if(E){var n=e[t];return n===J?void 0:n}return Y.call(e,t)?e[t]:void 0}function an(t){var e=this.__data__;return E?e[t]!==void 0:Y.call(e,t)}function cn(t,e){var n=this.__data__;return n[t]=E&&e===void 0?J:e,this}j.prototype.clear=nn;j.prototype.delete=rn;j.prototype.get=on;j.prototype.has=an;j.prototype.set=cn;function m(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function sn(){this.__data__=[]}function un(t){var e=this.__data__,n=G(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ze.call(e,n,1),!0}function ln(t){var e=this.__data__,n=G(e,t);return n<0?void 0:e[n][1]}function fn(t){return G(this.__data__,t)>-1}function hn(t,e){var n=this.__data__,r=G(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}m.prototype.clear=sn;m.prototype.delete=un;m.prototype.get=ln;m.prototype.has=fn;m.prototype.set=hn;function x(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function pn(){this.__data__={hash:new j,map:new(en||m),string:new j}}function dn(t){return N(this,t).delete(t)}function gn(t){return N(this,t).get(t)}function bn(t){return N(this,t).has(t)}function _n(t,e){return N(this,t).set(t,e),this}x.prototype.clear=pn;x.prototype.delete=dn;x.prototype.get=gn;x.prototype.has=bn;x.prototype.set=_n;function L(t){var e=-1,n=t?t.length:0;for(this.__data__=new x;++e<n;)this.add(t[e])}function yn(t){return this.__data__.set(t,J),this}function jn(t){return this.__data__.has(t)}L.prototype.add=L.prototype.push=yn;L.prototype.has=jn;function G(t,e){for(var n=t.length;n--;)if(Tn(t[n][0],e))return n;return-1}function vn(t,e,n){for(var r=n?$e:Ue,o=t[0].length,i=t.length,a=i,c=Array(i),h=1/0,l=[];a--;){var u=t[a];a&&e&&(u=bt(u,ke(e))),h=tn(u.length,h),c[a]=!n&&(e||o>=120&&u.length>=120)?new L(a&&u):void 0}u=t[0];var d=-1,g=c[0];t:for(;++d<o&&l.length<h;){var f=u[d],p=e?e(f):f;if(f=n||f!==0?f:0,!(g?_t(g,p):r(l,p,n))){for(a=i;--a;){var ht=c[a];if(!(ht?_t(ht,p):r(t[a],p,n)))continue t}g&&g.push(p),l.push(f)}}return l}function wn(t){if(!xt(t)||Cn(t))return!1;var e=mt(t)||Je(t)?Qe:Le;return e.test(Sn(t))}function On(t,e){return e=wt(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,o=wt(n.length-e,0),i=Array(o);++r<o;)i[r]=n[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=n[r];return a[e]=i,Be(t,this,a)}}function mn(t){return In(t)?t:[]}function N(t,e){var n=t.__data__;return xn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Ot(t,e){var n=qe(t,e);return wn(n)?n:void 0}function xn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Cn(t){return!!jt&&jt in t}function Sn(t){if(t!=null){try{return vt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var An=On(function(t){var e=bt(t,mn);return e.length&&e[0]===t[0]?vn(e):[]});function Tn(t,e){return t===e||t!==t&&e!==e}function En(t){return t!=null&&Pn(t.length)&&!mt(t)}function In(t){return Mn(t)&&En(t)}function mt(t){var e=xt(t)?Ze.call(t):"";return e==De||e==Re}function Pn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=He}function xt(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Mn(t){return!!t&&typeof t=="object"}Ct.exports=An});var It=R((Fo,Et)=>{function Hn(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Dn(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Rn(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Fn(t,e,n){if(e!==e)return Rn(t,Gn,n);for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}function Ln(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Gn(t){return t!==t}function Nn(t){return function(e){return t(e)}}var Bn=Array.prototype,At=Bn.splice,Tt=Math.max;function Un(t,e,n,r){var o=r?Ln:Fn,i=-1,a=e.length,c=t;for(t===e&&(e=Vn(e)),n&&(c=Dn(t,Nn(n)));++i<a;)for(var h=0,l=e[i],u=n?n(l):l;(h=o(c,u,h,r))>-1;)c!==t&&At.call(c,h,1),At.call(t,h,1);return t}function $n(t,e){return e=Tt(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,o=Tt(n.length-e,0),i=Array(o);++r<o;)i[r]=n[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=n[r];return a[e]=i,Hn(t,this,a)}}function Vn(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var Kn=$n(Wn);function Wn(t,e){return t&&t.length&&e&&e.length?Un(t,e):t}Et.exports=Kn});var Dt=R((Lo,Ht)=>{var kn="[object Object]";function qn(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(n){}return e}function Jn(t,e){return function(n){return t(e(n))}}var Xn=Function.prototype,Pt=Object.prototype,Mt=Xn.toString,Yn=Pt.hasOwnProperty,Zn=Mt.call(Object),Qn=Pt.toString,zn=Jn(Object.getPrototypeOf,Object);function tr(t){return!!t&&typeof t=="object"}function er(t){if(!tr(t)||Qn.call(t)!=kn||qn(t))return!1;var e=zn(t);if(e===null)return!0;var n=Yn.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Mt.call(n)==Zn}Ht.exports=er});var Oe=R((M,T)=>{var nr=200,Rt="__lodash_hash_undefined__",Ft=9007199254740991,Z="[object Arguments]",rr="[object Array]",Lt="[object Boolean]",Gt="[object Date]",or="[object Error]",Q="[object Function]",Nt="[object GeneratorFunction]",B="[object Map]",Bt="[object Number]",z="[object Object]",Ut="[object Promise]",$t="[object RegExp]",U="[object Set]",Vt="[object String]",Kt="[object Symbol]",tt="[object WeakMap]",Wt="[object ArrayBuffer]",$="[object DataView]",kt="[object Float32Array]",qt="[object Float64Array]",Jt="[object Int8Array]",Xt="[object Int16Array]",Yt="[object Int32Array]",Zt="[object Uint8Array]",Qt="[object Uint8ClampedArray]",zt="[object Uint16Array]",te="[object Uint32Array]",ir=/[\\^$.*+?()[\]{}|]/g,ar=/\w*$/,cr=/^\[object .+?Constructor\]$/,sr=/^(?:0|[1-9]\d*)$/,s={};s[Z]=s[rr]=s[Wt]=s[$]=s[Lt]=s[Gt]=s[kt]=s[qt]=s[Jt]=s[Xt]=s[Yt]=s[B]=s[Bt]=s[z]=s[$t]=s[U]=s[Vt]=s[Kt]=s[Zt]=s[Qt]=s[zt]=s[te]=!0;s[or]=s[Q]=s[tt]=!1;var ur=typeof global=="object"&&global&&global.Object===Object&&global,lr=typeof self=="object"&&self&&self.Object===Object&&self,b=ur||lr||Function("return this")(),ee=typeof M=="object"&&M&&!M.nodeType&&M,ne=ee&&typeof T=="object"&&T&&!T.nodeType&&T,fr=ne&&ne.exports===ee;function hr(t,e){return t.set(e[0],e[1]),t}function pr(t,e){return t.add(e),t}function dr(t,e){for(var n=-1,r=t?t.length:0;++n<r&&e(t[n],n,t)!==!1;);return t}function gr(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function re(t,e,n,r){var o=-1,i=t?t.length:0;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function br(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function _r(t,e){return t==null?void 0:t[e]}function oe(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(n){}return e}function ie(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}function et(t,e){return function(n){return t(e(n))}}function ae(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var yr=Array.prototype,jr=Function.prototype,V=Object.prototype,nt=b["__core-js_shared__"],ce=function(){var t=/[^.]+$/.exec(nt&&nt.keys&&nt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),se=jr.toString,y=V.hasOwnProperty,K=V.toString,vr=RegExp("^"+se.call(y).replace(ir,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ue=fr?b.Buffer:void 0,le=b.Symbol,fe=b.Uint8Array,wr=et(Object.getPrototypeOf,Object),Or=Object.create,mr=V.propertyIsEnumerable,xr=yr.splice,he=Object.getOwnPropertySymbols,Cr=ue?ue.isBuffer:void 0,Sr=et(Object.keys,Object),rt=A(b,"DataView"),I=A(b,"Map"),ot=A(b,"Promise"),it=A(b,"Set"),at=A(b,"WeakMap"),P=A(Object,"create"),Ar=O(rt),Tr=O(I),Er=O(ot),Ir=O(it),Pr=O(at),pe=le?le.prototype:void 0,de=pe?pe.valueOf:void 0;function v(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Mr(){this.__data__=P?P(null):{}}function Hr(t){return this.has(t)&&delete this.__data__[t]}function Dr(t){var e=this.__data__;if(P){var n=e[t];return n===Rt?void 0:n}return y.call(e,t)?e[t]:void 0}function Rr(t){var e=this.__data__;return P?e[t]!==void 0:y.call(e,t)}function Fr(t,e){var n=this.__data__;return n[t]=P&&e===void 0?Rt:e,this}v.prototype.clear=Mr;v.prototype.delete=Hr;v.prototype.get=Dr;v.prototype.has=Rr;v.prototype.set=Fr;function _(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Lr(){this.__data__=[]}function Gr(t){var e=this.__data__,n=W(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():xr.call(e,n,1),!0}function Nr(t){var e=this.__data__,n=W(e,t);return n<0?void 0:e[n][1]}function Br(t){return W(this.__data__,t)>-1}function Ur(t,e){var n=this.__data__,r=W(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}_.prototype.clear=Lr;_.prototype.delete=Gr;_.prototype.get=Nr;_.prototype.has=Br;_.prototype.set=Ur;function C(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function $r(){this.__data__={hash:new v,map:new(I||_),string:new v}}function Vr(t){return k(this,t).delete(t)}function Kr(t){return k(this,t).get(t)}function Wr(t){return k(this,t).has(t)}function kr(t,e){return k(this,t).set(t,e),this}C.prototype.clear=$r;C.prototype.delete=Vr;C.prototype.get=Kr;C.prototype.has=Wr;C.prototype.set=kr;function S(t){this.__data__=new _(t)}function qr(){this.__data__=new _}function Jr(t){return this.__data__.delete(t)}function Xr(t){return this.__data__.get(t)}function Yr(t){return this.__data__.has(t)}function Zr(t,e){var n=this.__data__;if(n instanceof _){var r=n.__data__;if(!I||r.length<nr-1)return r.push([t,e]),this;n=this.__data__=new C(r)}return n.set(t,e),this}S.prototype.clear=qr;S.prototype.delete=Jr;S.prototype.get=Xr;S.prototype.has=Yr;S.prototype.set=Zr;function Qr(t,e){var n=ut(t)||mo(t)?br(t.length,String):[],r=n.length,o=!!r;for(var i in t)(e||y.call(t,i))&&!(o&&(i=="length"||jo(i,r)))&&n.push(i);return n}function ge(t,e,n){var r=t[e];(!(y.call(t,e)&&je(r,n))||n===void 0&&!(e in t))&&(t[e]=n)}function W(t,e){for(var n=t.length;n--;)if(je(t[n][0],e))return n;return-1}function zr(t,e){return t&&be(e,lt(e),t)}function ct(t,e,n,r,o,i,a){var c;if(r&&(c=i?r(t,o,i,a):r(t)),c!==void 0)return c;if(!q(t))return t;var h=ut(t);if(h){if(c=bo(t),!e)return ho(t,c)}else{var l=w(t),u=l==Q||l==Nt;if(Co(t))return io(t,e);if(l==z||l==Z||u&&!i){if(oe(t))return i?t:{};if(c=_o(u?{}:t),!e)return po(t,zr(c,t))}else{if(!s[l])return i?t:{};c=yo(t,l,ct,e)}}a||(a=new S);var d=a.get(t);if(d)return d;if(a.set(t,c),!h)var g=n?go(t):lt(t);return dr(g||t,function(f,p){g&&(p=f,f=t[p]),ge(c,p,ct(f,e,n,r,p,t,a))}),c}function to(t){return q(t)?Or(t):{}}function eo(t,e,n){var r=e(t);return ut(t)?r:gr(r,n(t))}function no(t){return K.call(t)}function ro(t){if(!q(t)||wo(t))return!1;var e=we(t)||oe(t)?vr:cr;return e.test(O(t))}function oo(t){if(!ye(t))return Sr(t);var e=[];for(var n in Object(t))y.call(t,n)&&n!="constructor"&&e.push(n);return e}function io(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}function st(t){var e=new t.constructor(t.byteLength);return new fe(e).set(new fe(t)),e}function ao(t,e){var n=e?st(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function co(t,e,n){var r=e?n(ie(t),!0):ie(t);return re(r,hr,new t.constructor)}function so(t){var e=new t.constructor(t.source,ar.exec(t));return e.lastIndex=t.lastIndex,e}function uo(t,e,n){var r=e?n(ae(t),!0):ae(t);return re(r,pr,new t.constructor)}function lo(t){return de?Object(de.call(t)):{}}function fo(t,e){var n=e?st(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ho(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function be(t,e,n,r){n||(n={});for(var o=-1,i=e.length;++o<i;){var a=e[o],c=r?r(n[a],t[a],a,n,t):void 0;ge(n,a,c===void 0?t[a]:c)}return n}function po(t,e){return be(t,_e(t),e)}function go(t){return eo(t,lt,_e)}function k(t,e){var n=t.__data__;return vo(e)?n[typeof e=="string"?"string":"hash"]:n.map}function A(t,e){var n=_r(t,e);return ro(n)?n:void 0}var _e=he?et(he,Object):To,w=no;(rt&&w(new rt(new ArrayBuffer(1)))!=$||I&&w(new I)!=B||ot&&w(ot.resolve())!=Ut||it&&w(new it)!=U||at&&w(new at)!=tt)&&(w=function(t){var e=K.call(t),n=e==z?t.constructor:void 0,r=n?O(n):void 0;if(r)switch(r){case Ar:return $;case Tr:return B;case Er:return Ut;case Ir:return U;case Pr:return tt}return e});function bo(t){var e=t.length,n=t.constructor(e);return e&&typeof t[0]=="string"&&y.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function _o(t){return typeof t.constructor=="function"&&!ye(t)?to(wr(t)):{}}function yo(t,e,n,r){var o=t.constructor;switch(e){case Wt:return st(t);case Lt:case Gt:return new o(+t);case $:return ao(t,r);case kt:case qt:case Jt:case Xt:case Yt:case Zt:case Qt:case zt:case te:return fo(t,r);case B:return co(t,r,n);case Bt:case Vt:return new o(t);case $t:return so(t);case U:return uo(t,r,n);case Kt:return lo(t)}}function jo(t,e){return e=e==null?Ft:e,!!e&&(typeof t=="number"||sr.test(t))&&t>-1&&t%1==0&&t<e}function vo(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wo(t){return!!ce&&ce in t}function ye(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||V;return t===n}function O(t){if(t!=null){try{return se.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Oo(t){return ct(t,!0,!0)}function je(t,e){return t===e||t!==t&&e!==e}function mo(t){return xo(t)&&y.call(t,"callee")&&(!mr.call(t,"callee")||K.call(t)==Z)}var ut=Array.isArray;function ve(t){return t!=null&&So(t.length)&&!we(t)}function xo(t){return Ao(t)&&ve(t)}var Co=Cr||Eo;function we(t){var e=q(t)?K.call(t):"";return e==Q||e==Nt}function So(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ft}function q(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ao(t){return!!t&&typeof t=="object"}function lt(t){return ve(t)?Qr(t):oo(t)}function To(){return[]}function Eo(){return!1}T.exports=Oo});var Ho={};Pe(Ho,{combinations:()=>Mo,version:()=>Po});var xe=F(St(),1),Ce=F(It(),1),H=F(Dt(),1),ft=F(Oe(),1);var me="5.0.11";var Po=me;function Mo(t,e={}){function n(u){let d=[];for(let g=0;g<1<<u;g++){let f=[];for(let p=0;p<u;p++)f.push(g&1<<p?1:0);d.push(f)}return d}if(!t)throw new Error("[THROW_ID_01] missing input object");if(!(0,H.default)(t))throw new Error("[THROW_ID_02] the first input object must be a true object");if(e&&!(0,H.default)(e))throw new Error("[THROW_ID_03] the second override object must be a true object");let r=(0,ft.default)(t),o=(0,ft.default)(e),i=Object.keys(r),a=[],c=[];(0,H.default)(o)&&Object.keys(o).length&&(c=(0,xe.default)(Object.keys(o),Object.keys(r)),c.forEach(u=>(0,Ce.default)(i,u)));let h=n(Object.keys(i).length),l;return h.forEach((u,d)=>{l={},i.forEach((g,f)=>{l[g]=h[d][f]===1}),a.push(l)}),(0,H.default)(o)&&Object.keys(o).length&&a.forEach(u=>{c.forEach(d=>{u[d]=o[d]})}),a}return Me(Ho);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "object-boolean-combinations",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.11",
|
|
4
4
|
"description": "Consumes a defaults object with booleans, generates all possible variations of it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"all",
|
|
@@ -32,13 +32,15 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
34
34
|
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
35
|
-
"dts": "rollup -c",
|
|
35
|
+
"dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
|
|
36
36
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
37
37
|
"lect": "node '../../ops/lect/lect.js'",
|
|
38
38
|
"letspublish": "yarn publish || :",
|
|
39
39
|
"lint": "eslint . --fix",
|
|
40
40
|
"perf": "node perf/check.js",
|
|
41
41
|
"prepare": "echo 'ready'",
|
|
42
|
+
"prettier": "prettier",
|
|
43
|
+
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
|
|
42
44
|
"pretest": "yarn run lect && yarn run build",
|
|
43
45
|
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
44
46
|
"unit": "uvu test"
|
package/types/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
declare const version: string;
|
|
2
2
|
interface BoolValueObj {
|
|
3
|
-
|
|
3
|
+
[key: string]: boolean;
|
|
4
4
|
}
|
|
5
5
|
interface UnknownValueObj {
|
|
6
|
-
|
|
6
|
+
[key: string]: any;
|
|
7
7
|
}
|
|
8
|
-
declare function combinations(
|
|
8
|
+
declare function combinations(
|
|
9
|
+
originalIncomingObject: UnknownValueObj,
|
|
10
|
+
originalOverrideObject?: undefined | UnknownValueObj
|
|
11
|
+
): BoolValueObj[];
|
|
9
12
|
|
|
10
13
|
export { combinations, version };
|