object-boolean-combinations 6.1.4 → 6.1.8
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-2025 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
|
@@ -68,6 +68,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
68
68
|
|
|
69
69
|
MIT License.
|
|
70
70
|
|
|
71
|
-
Copyright © 2010-
|
|
71
|
+
Copyright © 2010-2025 Roy Revelt and other contributors.
|
|
72
72
|
|
|
73
73
|
<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-boolean-combinations
|
|
3
3
|
* @fileoverview Consumes a defaults object with booleans, generates all possible variations of it
|
|
4
|
-
* @version 6.1.
|
|
4
|
+
* @version 6.1.8
|
|
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{isPlainObject as i,intersection as
|
|
10
|
+
import{isPlainObject as i,intersection as y}from"codsen-utils";import O from"rfdc";var j="6.1.8";var f=O(),_=j;function R(c,l={}){function h(e){let t=[];for(let n=0;n<1<<e;n++){let r=[];for(let u=0;u<e;u++)r.push(n&1<<u?1:0);t.push(r)}return t}if(!c)throw new Error("[THROW_ID_01] missing input object");if(!i(c))throw new Error("[THROW_ID_02] the first input object must be a plain object");if(l&&!i(l))throw new Error("[THROW_ID_03] the second override object must be a plain object");let m=f(c),o=f(l),s=Object.keys(m),p=[],b=[];i(o)&&Object.keys(o).length&&(b=y(Object.keys(o),Object.keys(m)),s=s.filter(e=>!b.includes(e)));let d=h(Object.keys(s).length),a;return d.forEach((e,t)=>{a={},s.forEach((n,r)=>{a[n]=d[t][r]===1}),p.push(a)}),i(o)&&Object.keys(o).length&&p.forEach(e=>{b.forEach(t=>{e[t]=o[t]})}),p}export{R as combinations,_ as version};
|
|
@@ -1,17 +1,17 @@
|
|
|
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 6.1.
|
|
4
|
+
* @version 6.1.8
|
|
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
|
-
"use strict";var objectBooleanCombinations=(()=>{var
|
|
10
|
+
"use strict";var objectBooleanCombinations=(()=>{var S=Object.create;var h=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var M=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),$=(t,n)=>{for(var i in n)h(t,i,{get:n[i],enumerable:!0})},A=(t,n,i,f)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of E(n))!T.call(t,u)&&u!==i&&h(t,u,{get:()=>n[u],enumerable:!(f=D(n,u))||f.enumerable});return t};var O=(t,n,i)=>(i=t!=null?S(R(t)):{},A(n||!t||!t.__esModule?h(i,"default",{value:t,enumerable:!0}):i,t)),L=t=>A(h({},"__esModule",{value:!0}),t);var g=M((Q,w)=>{"use strict";w.exports=P;function m(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function P(t){if(t=t||{},t.circles)return F(t);let n=new Map;if(n.set(Date,s=>new Date(s)),n.set(Map,(s,a)=>new Map(f(Array.from(s),a))),n.set(Set,(s,a)=>new Set(f(Array.from(s),a))),t.constructorHandlers)for(let s of t.constructorHandlers)n.set(s[0],s[1]);let i=null;return t.proto?p:u;function f(s,a){let e=Object.keys(s),r=new Array(e.length);for(let c=0;c<e.length;c++){let o=e[c],l=s[o];typeof l!="object"||l===null?r[o]=l:l.constructor!==Object&&(i=n.get(l.constructor))?r[o]=i(l,a):ArrayBuffer.isView(l)?r[o]=m(l):r[o]=a(l)}return r}function u(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return f(s,u);if(s.constructor!==Object&&(i=n.get(s.constructor)))return i(s,u);let a={};for(let e in s){if(Object.hasOwnProperty.call(s,e)===!1)continue;let r=s[e];typeof r!="object"||r===null?a[e]=r:r.constructor!==Object&&(i=n.get(r.constructor))?a[e]=i(r,u):ArrayBuffer.isView(r)?a[e]=m(r):a[e]=u(r)}return a}function p(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return f(s,p);if(s.constructor!==Object&&(i=n.get(s.constructor)))return i(s,p);let a={};for(let e in s){let r=s[e];typeof r!="object"||r===null?a[e]=r:r.constructor!==Object&&(i=n.get(r.constructor))?a[e]=i(r,p):ArrayBuffer.isView(r)?a[e]=m(r):a[e]=p(r)}return a}}function F(t){let n=[],i=[],f=new Map;if(f.set(Date,e=>new Date(e)),f.set(Map,(e,r)=>new Map(p(Array.from(e),r))),f.set(Set,(e,r)=>new Set(p(Array.from(e),r))),t.constructorHandlers)for(let e of t.constructorHandlers)f.set(e[0],e[1]);let u=null;return t.proto?a:s;function p(e,r){let c=Object.keys(e),o=new Array(c.length);for(let l=0;l<c.length;l++){let d=c[l],b=e[d];if(typeof b!="object"||b===null)o[d]=b;else if(b.constructor!==Object&&(u=f.get(b.constructor)))o[d]=u(b,r);else if(ArrayBuffer.isView(b))o[d]=m(b);else{let j=n.indexOf(b);j!==-1?o[d]=i[j]:o[d]=r(b)}}return o}function s(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,s);if(e.constructor!==Object&&(u=f.get(e.constructor)))return u(e,s);let r={};n.push(e),i.push(r);for(let c in e){if(Object.hasOwnProperty.call(e,c)===!1)continue;let o=e[c];if(typeof o!="object"||o===null)r[c]=o;else if(o.constructor!==Object&&(u=f.get(o.constructor)))r[c]=u(o,s);else if(ArrayBuffer.isView(o))r[c]=m(o);else{let l=n.indexOf(o);l!==-1?r[c]=i[l]:r[c]=s(o)}}return n.pop(),i.pop(),r}function a(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,a);if(e.constructor!==Object&&(u=f.get(e.constructor)))return u(e,a);let r={};n.push(e),i.push(r);for(let c in e){let o=e[c];if(typeof o!="object"||o===null)r[c]=o;else if(o.constructor!==Object&&(u=f.get(o.constructor)))r[c]=u(o,a);else if(ArrayBuffer.isView(o))r[c]=m(o);else{let l=n.indexOf(o);l!==-1?r[c]=i[l]:r[c]=a(o)}}return n.pop(),i.pop(),r}}});var _={};$(_,{combinations:()=>I,version:()=>N});var x=O(g(),1);var W=(0,x.default)();function y(t){if(t==null||typeof t!="object")return!1;let n=Object.getPrototypeOf(t);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}function k(t=[],n=[]){return!t||!n?[]:Array.from(new Set(Array.from(t).filter(i=>new Set(n).has(i))))}var B=O(g(),1);var v="6.1.8";var C=(0,B.default)(),N=v;function I(t,n={}){function i(c){let o=[];for(let l=0;l<1<<c;l++){let d=[];for(let b=0;b<c;b++)d.push(l&1<<b?1:0);o.push(d)}return o}if(!t)throw new Error("[THROW_ID_01] missing input object");if(!y(t))throw new Error("[THROW_ID_02] the first input object must be a plain object");if(n&&!y(n))throw new Error("[THROW_ID_03] the second override object must be a plain object");let f=C(t),u=C(n),p=Object.keys(f),s=[],a=[];y(u)&&Object.keys(u).length&&(a=k(Object.keys(u),Object.keys(f)),p=p.filter(c=>!a.includes(c)));let e=i(Object.keys(p).length),r;return e.forEach((c,o)=>{r={},p.forEach((l,d)=>{r[l]=e[o][d]===1}),s.push(r)}),y(u)&&Object.keys(u).length&&s.forEach(c=>{a.forEach(o=>{c[o]=u[o]})}),s}return L(_);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.6.
|
|
14
|
+
* @version 1.6.7
|
|
15
15
|
* @author Roy Revelt, Codsen Ltd
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "object-boolean-combinations",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.8",
|
|
4
4
|
"description": "Consumes a defaults object with booleans, generates all possible variations of it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"all",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"homepage": "https://codsen.com/os/object-boolean-combinations",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/codsen/codsen.git",
|
|
21
|
+
"url": "git+https://github.com/codsen/codsen.git",
|
|
22
22
|
"directory": "packages/object-boolean-combinations"
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
41
41
|
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
42
42
|
"letspublish": "npm publish || :",
|
|
43
|
-
"lint": "eslint . --
|
|
43
|
+
"lint": "eslint . --fix",
|
|
44
44
|
"perf": "node perf/check.js",
|
|
45
45
|
"prep": "echo 'ready'",
|
|
46
46
|
"prettier": "prettier",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"codsen-utils": "^1.6.
|
|
71
|
-
"rfdc": "^1.
|
|
70
|
+
"codsen-utils": "^1.6.7",
|
|
71
|
+
"rfdc": "^1.4.1"
|
|
72
72
|
}
|
|
73
73
|
}
|