test-mixer 4.1.10 → 4.1.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/README.md +4 -4
- package/dist/test-mixer.esm.js +2 -2
- package/dist/test-mixer.umd.js +4 -4
- package/package.json +4 -4
- package/types/index.d.ts +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ assert.deepEqual(
|
|
|
50
50
|
{
|
|
51
51
|
// empty first arg object means you want all combinations
|
|
52
52
|
},
|
|
53
|
-
defaultOpts
|
|
53
|
+
defaultOpts,
|
|
54
54
|
),
|
|
55
55
|
[
|
|
56
56
|
{
|
|
@@ -101,7 +101,7 @@ assert.deepEqual(
|
|
|
101
101
|
inflateTires: true,
|
|
102
102
|
extinguishersCount: 1,
|
|
103
103
|
},
|
|
104
|
-
]
|
|
104
|
+
],
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
// let's "pin" a value, prepare two sets of options objects,
|
|
@@ -112,7 +112,7 @@ const variationsWithScrapeWindshieldOn = mixer(
|
|
|
112
112
|
{
|
|
113
113
|
scrapeWindshield: true,
|
|
114
114
|
},
|
|
115
|
-
defaultOpts
|
|
115
|
+
defaultOpts,
|
|
116
116
|
);
|
|
117
117
|
assert.deepEqual(variationsWithScrapeWindshieldOn, [
|
|
118
118
|
{
|
|
@@ -146,7 +146,7 @@ const variationsWithScrapeWindshieldOff = mixer(
|
|
|
146
146
|
{
|
|
147
147
|
scrapeWindshield: false,
|
|
148
148
|
},
|
|
149
|
-
defaultOpts
|
|
149
|
+
defaultOpts,
|
|
150
150
|
);
|
|
151
151
|
assert.equal(variationsWithScrapeWindshieldOff.length, 4);
|
|
152
152
|
```
|
package/dist/test-mixer.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name test-mixer
|
|
3
3
|
* @fileoverview Test helper to generate function opts object variations
|
|
4
|
-
* @version 4.1.
|
|
4
|
+
* @version 4.1.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/test-mixer/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{combinations as u}from"object-boolean-combinations";import m from"rfdc";var i="4.1.
|
|
10
|
+
import{combinations as u}from"object-boolean-combinations";import m from"rfdc";var i="4.1.11";var l=m(),h=i;function j(o={},t={}){if(o&&typeof o!="object")throw new Error("test-mixer: [THROW_ID_01] the first input arg is missing!");if(t&&typeof t!="object")throw new Error("test-mixer: [THROW_ID_02] the second input arg is missing!");let s;if(typeof o=="object"&&typeof t=="object"&&Object.keys(o).filter(e=>typeof o[e]=="boolean").some(e=>Object.keys(t).includes(e)?!1:(s=e,!0)))throw new Error(`test-mixer: [THROW_ID_03] the second input arg object should be defaults; it should be a superset of 1st input arg object. However, 1st input arg object contains key "${s}" which 2nd input arg object doesn't have.`);if(!Object.keys(t).length)return[];let c=l(o),n=l(t),r={};return Object.keys(t).forEach(e=>{typeof n[e]=="boolean"&&!Object.keys(o).includes(e)&&(r[e]=n[e])}),u(r).map(e=>({...t,...c,...e}))}export{j as mixer,h as version};
|
package/dist/test-mixer.umd.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name test-mixer
|
|
3
3
|
* @fileoverview Test helper to generate function opts object variations
|
|
4
|
-
* @version 4.1.
|
|
4
|
+
* @version 4.1.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/test-mixer/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var testMixer=(()=>{var T=Object.create;var y=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,_=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var v=(r,t,o)=>t in r?y(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,h=(r,t)=>{for(var o in t||(t={}))D.call(t,o)&&v(r,o,t[o]);if(j)for(var o of j(t))I.call(t,o)&&v(r,o,t[o]);return r};var L=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),W=(r,t)=>{for(var o in t)y(r,o,{get:t[o],enumerable:!0})},O=(r,t,o,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of V(t))!D.call(r,i)&&i!==o&&y(r,i,{get:()=>t[i],enumerable:!(f=N(t,i))||f.enumerable});return r};var A=(r,t,o)=>(o=r!=null?T(_(r)):{},O(t||!r||!r.__esModule?y(o,"default",{value:r,enumerable:!0}):o,r)),F=r=>O(y({},"__esModule",{value:!0}),r);var g=L((G,x)=>{"use strict";x.exports=H;function b(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function H(r){if(r=r||{},r.circles)return J(r);return r.proto?f:o;function t(i,a){for(var n=Object.keys(i),e=new Array(n.length),l=0;l<n.length;l++){var s=n[l],u=i[s];typeof u!="object"||u===null?e[s]=u:u instanceof Date?e[s]=new Date(u):ArrayBuffer.isView(u)?e[s]=b(u):e[s]=a(u)}return e}function o(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return t(i,o);if(i instanceof Map)return new Map(t(Array.from(i),o));if(i instanceof Set)return new Set(t(Array.from(i),o));var a={};for(var n in i)if(Object.hasOwnProperty.call(i,n)!==!1){var e=i[n];typeof e!="object"||e===null?a[n]=e:e instanceof Date?a[n]=new Date(e):e instanceof Map?a[n]=new Map(t(Array.from(e),o)):e instanceof Set?a[n]=new Set(t(Array.from(e),o)):ArrayBuffer.isView(e)?a[n]=b(e):a[n]=o(e)}return a}function f(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return t(i,f);if(i instanceof Map)return new Map(t(Array.from(i),f));if(i instanceof Set)return new Set(t(Array.from(i),f));var a={};for(var n in i){var e=i[n];typeof e!="object"||e===null?a[n]=e:e instanceof Date?a[n]=new Date(e):e instanceof Map?a[n]=new Map(t(Array.from(e),f)):e instanceof Set?a[n]=new Set(t(Array.from(e),f)):ArrayBuffer.isView(e)?a[n]=b(e):a[n]=f(e)}return a}}function J(r){var t=[],o=[];return r.proto?a:i;function f(n,e){for(var l=Object.keys(n),s=new Array(l.length),u=0;u<l.length;u++){var p=l[u],c=n[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]=b(c);else{var m=t.indexOf(c);m!==-1?s[p]=o[m]:s[p]=e(c)}}return s}function i(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return f(n,i);if(n instanceof Map)return new Map(f(Array.from(n),i));if(n instanceof Set)return new Set(f(Array.from(n),i));var e={};t.push(n),o.push(e);for(var l in n)if(Object.hasOwnProperty.call(n,l)!==!1){var s=n[l];if(typeof s!="object"||s===null)e[l]=s;else if(s instanceof Date)e[l]=new Date(s);else if(s instanceof Map)e[l]=new Map(f(Array.from(s),i));else if(s instanceof Set)e[l]=new Set(f(Array.from(s),i));else if(ArrayBuffer.isView(s))e[l]=b(s);else{var u=t.indexOf(s);u!==-1?e[l]=o[u]:e[l]=i(s)}}return t.pop(),o.pop(),e}function a(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return f(n,a);if(n instanceof Map)return new Map(f(Array.from(n),a));if(n instanceof Set)return new Set(f(Array.from(n),a));var e={};t.push(n),o.push(e);for(var l in n){var s=n[l];if(typeof s!="object"||s===null)e[l]=s;else if(s instanceof Date)e[l]=new Date(s);else if(s instanceof Map)e[l]=new Map(f(Array.from(s),a));else if(s instanceof Set)e[l]=new Set(f(Array.from(s),a));else if(ArrayBuffer.isView(s))e[l]=b(s);else{var u=t.indexOf(s);u!==-1?e[l]=o[u]:e[l]=a(s)}}return t.pop(),o.pop(),e}}});var Z={};W(Z,{mixer:()=>q,version:()=>U});var S=A(g(),1);var K=(0,S.default)();function d(r){if(r==null||typeof r!="object")return!1;let t=Object.getPrototypeOf(r);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}function C(r=[],t=[]){return!r||!t?[]:Array.from(new Set(Array.from(r).filter(o=>new Set(t).has(o))))}var $=A(g(),1);var E=(0,$.default)();function B(r,t={}){function o(u){let p=[];for(let c=0;c<1<<u;c++){let m=[];for(let w=0;w<u;w++)m.push(c&1<<w?1:0);p.push(m)}return p}if(!r)throw new Error("[THROW_ID_01] missing input object");if(!d(r))throw new Error("[THROW_ID_02] the first input object must be a plain object");if(t&&!d(t))throw new Error("[THROW_ID_03] the second override object must be a plain object");let f=E(r),i=E(t),a=Object.keys(f),n=[],e=[];d(i)&&Object.keys(i).length&&(e=C(Object.keys(i),Object.keys(f)),a=a.filter(u=>!e.includes(u)));let l=o(Object.keys(a).length),s;return l.forEach((u,p)=>{s={},a.forEach((c,m)=>{s[c]=l[p][m]===1}),n.push(s)}),d(i)&&Object.keys(i).length&&n.forEach(u=>{e.forEach(p=>{u[p]=i[p]})}),n}var P=A(g(),1);var M="4.1.
|
|
10
|
+
"use strict";var testMixer=(()=>{var T=Object.create;var y=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,_=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var v=(r,t,o)=>t in r?y(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,h=(r,t)=>{for(var o in t||(t={}))D.call(t,o)&&v(r,o,t[o]);if(j)for(var o of j(t))I.call(t,o)&&v(r,o,t[o]);return r};var L=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),W=(r,t)=>{for(var o in t)y(r,o,{get:t[o],enumerable:!0})},O=(r,t,o,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of V(t))!D.call(r,i)&&i!==o&&y(r,i,{get:()=>t[i],enumerable:!(f=N(t,i))||f.enumerable});return r};var A=(r,t,o)=>(o=r!=null?T(_(r)):{},O(t||!r||!r.__esModule?y(o,"default",{value:r,enumerable:!0}):o,r)),F=r=>O(y({},"__esModule",{value:!0}),r);var g=L((G,x)=>{"use strict";x.exports=H;function b(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function H(r){if(r=r||{},r.circles)return J(r);return r.proto?f:o;function t(i,a){for(var n=Object.keys(i),e=new Array(n.length),l=0;l<n.length;l++){var s=n[l],u=i[s];typeof u!="object"||u===null?e[s]=u:u instanceof Date?e[s]=new Date(u):ArrayBuffer.isView(u)?e[s]=b(u):e[s]=a(u)}return e}function o(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return t(i,o);if(i instanceof Map)return new Map(t(Array.from(i),o));if(i instanceof Set)return new Set(t(Array.from(i),o));var a={};for(var n in i)if(Object.hasOwnProperty.call(i,n)!==!1){var e=i[n];typeof e!="object"||e===null?a[n]=e:e instanceof Date?a[n]=new Date(e):e instanceof Map?a[n]=new Map(t(Array.from(e),o)):e instanceof Set?a[n]=new Set(t(Array.from(e),o)):ArrayBuffer.isView(e)?a[n]=b(e):a[n]=o(e)}return a}function f(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return t(i,f);if(i instanceof Map)return new Map(t(Array.from(i),f));if(i instanceof Set)return new Set(t(Array.from(i),f));var a={};for(var n in i){var e=i[n];typeof e!="object"||e===null?a[n]=e:e instanceof Date?a[n]=new Date(e):e instanceof Map?a[n]=new Map(t(Array.from(e),f)):e instanceof Set?a[n]=new Set(t(Array.from(e),f)):ArrayBuffer.isView(e)?a[n]=b(e):a[n]=f(e)}return a}}function J(r){var t=[],o=[];return r.proto?a:i;function f(n,e){for(var l=Object.keys(n),s=new Array(l.length),u=0;u<l.length;u++){var p=l[u],c=n[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]=b(c);else{var m=t.indexOf(c);m!==-1?s[p]=o[m]:s[p]=e(c)}}return s}function i(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return f(n,i);if(n instanceof Map)return new Map(f(Array.from(n),i));if(n instanceof Set)return new Set(f(Array.from(n),i));var e={};t.push(n),o.push(e);for(var l in n)if(Object.hasOwnProperty.call(n,l)!==!1){var s=n[l];if(typeof s!="object"||s===null)e[l]=s;else if(s instanceof Date)e[l]=new Date(s);else if(s instanceof Map)e[l]=new Map(f(Array.from(s),i));else if(s instanceof Set)e[l]=new Set(f(Array.from(s),i));else if(ArrayBuffer.isView(s))e[l]=b(s);else{var u=t.indexOf(s);u!==-1?e[l]=o[u]:e[l]=i(s)}}return t.pop(),o.pop(),e}function a(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return f(n,a);if(n instanceof Map)return new Map(f(Array.from(n),a));if(n instanceof Set)return new Set(f(Array.from(n),a));var e={};t.push(n),o.push(e);for(var l in n){var s=n[l];if(typeof s!="object"||s===null)e[l]=s;else if(s instanceof Date)e[l]=new Date(s);else if(s instanceof Map)e[l]=new Map(f(Array.from(s),a));else if(s instanceof Set)e[l]=new Set(f(Array.from(s),a));else if(ArrayBuffer.isView(s))e[l]=b(s);else{var u=t.indexOf(s);u!==-1?e[l]=o[u]:e[l]=a(s)}}return t.pop(),o.pop(),e}}});var Z={};W(Z,{mixer:()=>q,version:()=>U});var S=A(g(),1);var K=(0,S.default)();function d(r){if(r==null||typeof r!="object")return!1;let t=Object.getPrototypeOf(r);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}function C(r=[],t=[]){return!r||!t?[]:Array.from(new Set(Array.from(r).filter(o=>new Set(t).has(o))))}var $=A(g(),1);var E=(0,$.default)();function B(r,t={}){function o(u){let p=[];for(let c=0;c<1<<u;c++){let m=[];for(let w=0;w<u;w++)m.push(c&1<<w?1:0);p.push(m)}return p}if(!r)throw new Error("[THROW_ID_01] missing input object");if(!d(r))throw new Error("[THROW_ID_02] the first input object must be a plain object");if(t&&!d(t))throw new Error("[THROW_ID_03] the second override object must be a plain object");let f=E(r),i=E(t),a=Object.keys(f),n=[],e=[];d(i)&&Object.keys(i).length&&(e=C(Object.keys(i),Object.keys(f)),a=a.filter(u=>!e.includes(u)));let l=o(Object.keys(a).length),s;return l.forEach((u,p)=>{s={},a.forEach((c,m)=>{s[c]=l[p][m]===1}),n.push(s)}),d(i)&&Object.keys(i).length&&n.forEach(u=>{e.forEach(p=>{u[p]=i[p]})}),n}var P=A(g(),1);var M="4.1.11";var R=(0,P.default)(),U=M;function q(r={},t={}){if(r&&typeof r!="object")throw new Error("test-mixer: [THROW_ID_01] the first input arg is missing!");if(t&&typeof t!="object")throw new Error("test-mixer: [THROW_ID_02] the second input arg is missing!");let o;if(typeof r=="object"&&typeof t=="object"&&Object.keys(r).filter(e=>typeof r[e]=="boolean").some(e=>Object.keys(t).includes(e)?!1:(o=e,!0)))throw new Error(`test-mixer: [THROW_ID_03] the second input arg object should be defaults; it should be a superset of 1st input arg object. However, 1st input arg object contains key "${o}" which 2nd input arg object doesn't have.`);if(!Object.keys(t).length)return[];let f=R(r),i=R(t),a={};return Object.keys(t).forEach(e=>{typeof i[e]=="boolean"&&!Object.keys(r).includes(e)&&(a[e]=i[e])}),B(a).map(e=>h(h(h({},t),f),e))}return F(Z);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.6.
|
|
14
|
+
* @version 1.6.1
|
|
15
15
|
* @author Roy Revelt, Codsen Ltd
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name object-boolean-combinations
|
|
21
21
|
* @fileoverview Consumes a defaults object with booleans, generates all possible variations of it
|
|
22
|
-
* @version 6.1.
|
|
22
|
+
* @version 6.1.2
|
|
23
23
|
* @author Roy Revelt, Codsen Ltd
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/object-boolean-combinations/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-mixer",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.11",
|
|
4
4
|
"description": "Test helper to generate function opts object variations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"combinations",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"cjs-on": "exit 0",
|
|
38
38
|
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
39
39
|
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
40
|
-
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --
|
|
40
|
+
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
|
|
41
41
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
42
42
|
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
43
43
|
"letspublish": "npm publish || :",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"perf": "node perf/check.js",
|
|
46
46
|
"prep": "echo 'ready'",
|
|
47
47
|
"prettier": "prettier",
|
|
48
|
-
"prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --
|
|
48
|
+
"prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
|
|
49
49
|
"pretest": "npm run lect && npm run build",
|
|
50
50
|
"test": "npm run devtest",
|
|
51
51
|
"unit": "uvu test"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"object-boolean-combinations": "^6.1.
|
|
71
|
+
"object-boolean-combinations": "^6.1.2",
|
|
72
72
|
"rfdc": "^1.3.0"
|
|
73
73
|
}
|
|
74
74
|
}
|