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 +24 -2
- package/LICENSE +1 -1
- package/README.md +4 -3
- package/dist/object-boolean-combinations.esm.js +2 -2
- package/dist/object-boolean-combinations.umd.js +3 -3
- package/package.json +25 -24
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.
|
|
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
|
-
-
|
|
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-
|
|
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-
|
|
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.
|
|
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{
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
35
|
-
"
|
|
36
|
-
"
|
|
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 &&
|
|
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'
|
|
42
|
-
"
|
|
43
|
-
"lint": "
|
|
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": "
|
|
47
|
-
"prettier:format": "
|
|
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
|
-
|
|
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.
|
|
71
|
-
|
|
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/"
|