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-2024 Roy Revelt and other contributors
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-2024 Roy Revelt and other contributors.
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
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 g}from"codsen-utils";import O from"rfdc";var j="6.1.4";var f=O(),_=j;function R(c,l={}){function h(e){let t=[];for(let s=0;s<1<<e;s++){let r=[];for(let u=0;u<e;u++)r.push(s&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),n=Object.keys(m),p=[],b=[];i(o)&&Object.keys(o).length&&(b=g(Object.keys(o),Object.keys(m)),n=n.filter(e=>!b.includes(e)));let d=h(Object.keys(n).length),a;return d.forEach((e,t)=>{a={},n.forEach((s,r)=>{a[s]=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};
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
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 C=Object.create;var d=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var T=(i,r)=>()=>(r||i((r={exports:{}}).exports,r),r.exports),$=(i,r)=>{for(var f in r)d(i,f,{get:r[f],enumerable:!0})},A=(i,r,f,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of M(r))!R.call(i,n)&&n!==f&&d(i,n,{get:()=>r[n],enumerable:!(u=B(r,n))||u.enumerable});return i};var g=(i,r,f)=>(f=i!=null?C(E(i)):{},A(r||!i||!i.__esModule?d(f,"default",{value:i,enumerable:!0}):f,i)),L=i=>A(d({},"__esModule",{value:!0}),i);var w=T((W,j)=>{"use strict";j.exports=P;function m(i){return i instanceof Buffer?Buffer.from(i):new i.constructor(i.buffer.slice(),i.byteOffset,i.length)}function P(i){if(i=i||{},i.circles)return F(i);return i.proto?u:f;function r(n,a){for(var e=Object.keys(n),t=new Array(e.length),o=0;o<e.length;o++){var s=e[o],l=n[s];typeof l!="object"||l===null?t[s]=l:l instanceof Date?t[s]=new Date(l):ArrayBuffer.isView(l)?t[s]=m(l):t[s]=a(l)}return t}function f(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return r(n,f);if(n instanceof Map)return new Map(r(Array.from(n),f));if(n instanceof Set)return new Set(r(Array.from(n),f));var a={};for(var e in n)if(Object.hasOwnProperty.call(n,e)!==!1){var t=n[e];typeof t!="object"||t===null?a[e]=t:t instanceof Date?a[e]=new Date(t):t instanceof Map?a[e]=new Map(r(Array.from(t),f)):t instanceof Set?a[e]=new Set(r(Array.from(t),f)):ArrayBuffer.isView(t)?a[e]=m(t):a[e]=f(t)}return a}function u(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return r(n,u);if(n instanceof Map)return new Map(r(Array.from(n),u));if(n instanceof Set)return new Set(r(Array.from(n),u));var a={};for(var e in n){var t=n[e];typeof t!="object"||t===null?a[e]=t:t instanceof Date?a[e]=new Date(t):t instanceof Map?a[e]=new Map(r(Array.from(t),u)):t instanceof Set?a[e]=new Set(r(Array.from(t),u)):ArrayBuffer.isView(t)?a[e]=m(t):a[e]=u(t)}return a}}function F(i){var r=[],f=[];return i.proto?a:n;function u(e,t){for(var o=Object.keys(e),s=new Array(o.length),l=0;l<o.length;l++){var p=o[l],c=e[p];if(typeof c!="object"||c===null)s[p]=c;else if(c instanceof Date)s[p]=new Date(c);else if(ArrayBuffer.isView(c))s[p]=m(c);else{var b=r.indexOf(c);b!==-1?s[p]=f[b]:s[p]=t(c)}}return s}function n(e){if(typeof e!="object"||e===null)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return u(e,n);if(e instanceof Map)return new Map(u(Array.from(e),n));if(e instanceof Set)return new Set(u(Array.from(e),n));var t={};r.push(e),f.push(t);for(var o in e)if(Object.hasOwnProperty.call(e,o)!==!1){var s=e[o];if(typeof s!="object"||s===null)t[o]=s;else if(s instanceof Date)t[o]=new Date(s);else if(s instanceof Map)t[o]=new Map(u(Array.from(s),n));else if(s instanceof Set)t[o]=new Set(u(Array.from(s),n));else if(ArrayBuffer.isView(s))t[o]=m(s);else{var l=r.indexOf(s);l!==-1?t[o]=f[l]:t[o]=n(s)}}return r.pop(),f.pop(),t}function a(e){if(typeof e!="object"||e===null)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return u(e,a);if(e instanceof Map)return new Map(u(Array.from(e),a));if(e instanceof Set)return new Set(u(Array.from(e),a));var t={};r.push(e),f.push(t);for(var o in e){var s=e[o];if(typeof s!="object"||s===null)t[o]=s;else if(s instanceof Date)t[o]=new Date(s);else if(s instanceof Map)t[o]=new Map(u(Array.from(s),a));else if(s instanceof Set)t[o]=new Set(u(Array.from(s),a));else if(ArrayBuffer.isView(s))t[o]=m(s);else{var l=r.indexOf(s);l!==-1?t[o]=f[l]:t[o]=a(s)}}return r.pop(),f.pop(),t}}});var V={};$(V,{combinations:()=>_,version:()=>I});var v=g(w(),1);var H=(0,v.default)();function y(i){if(i==null||typeof i!="object")return!1;let r=Object.getPrototypeOf(i);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in i)&&!(Symbol.toStringTag in i)}function O(i=[],r=[]){return!i||!r?[]:Array.from(new Set(Array.from(i).filter(f=>new Set(r).has(f))))}var x=g(w(),1);var D="6.1.4";var S=(0,x.default)(),I=D;function _(i,r={}){function f(l){let p=[];for(let c=0;c<1<<l;c++){let b=[];for(let h=0;h<l;h++)b.push(c&1<<h?1:0);p.push(b)}return p}if(!i)throw new Error("[THROW_ID_01] missing input object");if(!y(i))throw new Error("[THROW_ID_02] the first input object must be a plain object");if(r&&!y(r))throw new Error("[THROW_ID_03] the second override object must be a plain object");let u=S(i),n=S(r),a=Object.keys(u),e=[],t=[];y(n)&&Object.keys(n).length&&(t=O(Object.keys(n),Object.keys(u)),a=a.filter(l=>!t.includes(l)));let o=f(Object.keys(a).length),s;return o.forEach((l,p)=>{s={},a.forEach((c,b)=>{s[c]=o[p][b]===1}),e.push(s)}),y(n)&&Object.keys(n).length&&e.forEach(l=>{t.forEach(p=>{l[p]=n[p]})}),e}return L(V);})();
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.3
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.4",
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 . --ext .js --ext .ts --fix",
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.3",
71
- "rfdc": "^1.3.0"
70
+ "codsen-utils": "^1.6.7",
71
+ "rfdc": "^1.4.1"
72
72
  }
73
73
  }