object-boolean-combinations 6.2.3 → 6.3.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 CHANGED
@@ -3,11 +3,33 @@
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
- ## 6.2.0 (2025-10-15)
6
+ ## 6.3.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
+
12
+ ## 6.3.0 (2026-08-19)
13
+
14
+ ### Bug Fixes
15
+
16
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
17
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
18
+ - tweak types ([d1360f6](https://github.com/codsen/codsen/commit/d1360f60b86ca156e2e97bebc52c3577422678f3))
7
19
 
8
20
  ### Features
9
21
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
22
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
23
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
24
+
25
+ ### Performance Improvements
26
+
27
+ - build boolean combinations without an intermediate matrix ([87defb1](https://github.com/codsen/codsen/commit/87defb187b407b0ed0bd509eb0e13d3c6cf35714))
28
+
29
+ ### Reverts
30
+
31
+ - 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)
32
+ - 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
33
 
12
34
  ## 6.1.0 (2023-05-13)
13
35
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
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-boolean-combinations
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 { combinations } from "object-boolean-combinations";
38
38
 
@@ -56,9 +56,10 @@ assert.deepEqual(
56
56
  // you get 2^n plain objects in an array
57
57
  ```
58
58
 
59
+
59
60
  ## Documentation
60
61
 
61
- Please [visit codsen.com](https://codsen.com/os/object-boolean-combinations/) for a full description of the API.
62
+ Please [visit codsen.com](https://codsen.com/os/object-boolean-combinations/) 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-boolean-combinations/CHANGELOG.md).
62
63
 
63
64
  ## Contributing
64
65
 
@@ -68,6 +69,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
68
69
 
69
70
  MIT License
70
71
 
71
- Copyright © 2010-2025 Roy Revelt and other contributors
72
+ Copyright © 2010-2026 Roy Revelt and other contributors
72
73
 
73
74
  <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.2.3
4
+ * @version 6.3.1
5
5
  * @author Roy Revelt
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 y}from"codsen-utils";import O from"rfdc";var j="6.2.3";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};
10
+ import{deepClone as f,isPlainObject as m}from"codsen-utils";var b="6.3.1";var v=b;function w(n,o={}){if(!n)throw new Error("object-boolean-combinations/combinations(): [THROW_ID_01] missing input object");if(!m(n))throw new Error("object-boolean-combinations/combinations(): [THROW_ID_02] the first input object must be a plain object");if(o&&!m(o))throw new Error("object-boolean-combinations/combinations(): [THROW_ID_03] the second override object must be a plain object");let c=Object.keys(n),d=new Set(c),s=Object.keys(o).filter(e=>d.has(e)),u=new Set(s),i=c.filter(e=>!u.has(e)),a=s.length?f(o):null,l=2**i.length,p=new Array(l);for(let e=0;e<l;e++){let r={};for(let t=0;t<i.length;t++)r[i[t]]=(e&1<<t)!==0;if(a)for(let t of s)r[t]=a[t];p[e]=r}return p}export{w as combinations,v 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.2.3
4
+ * @version 6.3.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/object-boolean-combinations/}
8
8
  */
9
9
 
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.2.3";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(_);})();
10
+ "use strict";var objectBooleanCombinations=(()=>{var d=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var x=(e,t,n)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var k=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},S=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of O(t))!C.call(e,i)&&i!==n&&d(e,i,{get:()=>t[i],enumerable:!(o=w(t,i))||o.enumerable});return e};var D=e=>S(d({},"__esModule",{value:!0}),e);var h=(e,t,n)=>x(e,typeof t!="symbol"?t+"":t,n);var B={};k(B,{combinations:()=>M,version:()=>$});var T=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"]);var R=class{constructor(){h(this,"hasRepeatedReferences",!1);h(this,"clones",[]);h(this,"index");h(this,"sources",[])}get(e){if(this.index){let n=this.index.get(e);return n!==void 0&&(this.hasRepeatedReferences=!0),n}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let n=0;n<this.sources.length;n++)this.index.set(this.sources[n],this.clones[n]);this.sources=[],this.clones=[]}}};function v(e,t){let n=t.get(e);if(n!==void 0)return n;let o=e.slice(0);return t.set(e,o),o}function W(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let r=Buffer.from(e);return t.set(e,r),r}let n=v(e.buffer,t);if(e instanceof DataView){let r=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,r),r}let o=e.constructor,i=new o(n,e.byteOffset,e.length);return t.set(e,i),i}function b(e,t,n,o){for(let i of n){let r=t[i];e[i]=typeof r!="object"||r===null?r:p(r,o)}}function p(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let r=e.length,l=new Array(r);t.set(e,l);let u=e,c=Object.keys(e);if(c.length===r&&(r===0||c[r-1]==="".concat(r-1)))for(let a=0;a<r;a++){let s=u[a];l[a]=typeof s!="object"||s===null?s:p(s,t)}else b(l,u,c,t);return l}let o=Object.getPrototypeOf(e);if(o===Object.prototype||o===null){let r={};return t.set(e,r),b(r,e,Object.keys(e),t),r}if(e instanceof Date){let r=new Date(e.getTime());return t.set(e,r),r}if(ArrayBuffer.isView(e))return W(e,t);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return v(e,t);if(e instanceof Map){let r=new Map;t.set(e,r);for(let[l,u]of e)r.set(p(l,t),p(u,t));return r}if(e instanceof Set){let r=new Set;t.set(e,r);for(let l of e)r.add(p(l,t));return r}let i={};return t.set(e,i),b(i,e,Object.keys(e),t),i}function A(e){return p(e,new R)}function m(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 y,L=(y=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:y.get;var P=Date.prototype.getTime;var j="6.3.1";var $=j;function M(e,t={}){if(!e)throw new Error("object-boolean-combinations/combinations(): [THROW_ID_01] missing input object");if(!m(e))throw new Error("object-boolean-combinations/combinations(): [THROW_ID_02] the first input object must be a plain object");if(t&&!m(t))throw new Error("object-boolean-combinations/combinations(): [THROW_ID_03] the second override object must be a plain object");let n=Object.keys(e),o=new Set(n),i=Object.keys(t).filter(s=>o.has(s)),r=new Set(i),l=n.filter(s=>!r.has(s)),u=i.length?A(t):null,c=2**l.length,a=new Array(c);for(let s=0;s<c;s++){let g={};for(let f=0;f<l.length;f++)g[l[f]]=(s&1<<f)!==0;if(u)for(let f of i)g[f]=u[f];a[s]=g}return a}return D(B);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.7.3
14
+ * @version 1.9.0
15
15
  * @author Roy Revelt
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.2.3",
3
+ "version": "6.3.1",
4
4
  "description": "Consumes a defaults object with booleans, generates all possible variations of it",
5
5
  "keywords": [
6
6
  "all",
@@ -31,44 +31,45 @@
31
31
  },
32
32
  "types": "types/index.d.ts",
33
33
  "scripts": {
34
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
35
- "cjs-off": "exit 0",
36
- "cjs-on": "exit 0",
37
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
34
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
35
+ "coverage": "c8 uvu test",
36
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
38
37
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
39
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
38
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
40
39
  "examples": "node '../../ops/scripts/run-examples.js'",
41
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
42
- "letspublish": "npm publish --provenance || :",
43
- "lint": "eslint . --fix --concurrency=auto --cache",
40
+ "lect": "node '../../ops/lect/lect.js'",
41
+ "lect:check": "node '../../ops/lect/lect.js' --check",
42
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
43
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
44
44
  "perf": "node perf/check.js",
45
45
  "prep": "echo 'ready'",
46
- "prettier": "prettier",
47
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
48
- "pretest": "npm run lect && npm run build",
46
+ "prettier": "biome format",
47
+ "prettier:format": "biome format --write .",
48
+ "pretest": "npm run lect:check && npm run build",
49
49
  "test": "npm run devtest",
50
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
50
51
  "unit": "uvu test"
51
52
  },
52
- "engines": {
53
- "node": ">=14.18.0"
54
- },
55
53
  "c8": {
54
+ "all": true,
55
+ "branches": 100,
56
56
  "check-coverage": true,
57
- "exclude": [
58
- "**/test/**/*.*"
59
- ],
60
- "lines": 100
57
+ "exclude": ["**/test/**/*.*"],
58
+ "functions": 100,
59
+ "include": ["dist/*.esm.js"],
60
+ "lines": 100,
61
+ "statements": 100
61
62
  },
62
63
  "lect": {
63
64
  "licence": {
64
- "extras": [
65
- ""
66
- ]
65
+ "extras": [""]
67
66
  }
68
67
  },
69
68
  "dependencies": {
70
- "codsen-utils": "^1.7.3",
71
- "rfdc": "^1.4.1"
69
+ "codsen-utils": "^1.9.0"
70
+ },
71
+ "engines": {
72
+ "node": ">=18.20.8"
72
73
  },
73
74
  "publishConfig": {
74
75
  "registry": "https://registry.npmjs.org/"