type-enforcer-test-helper 1.3.8 → 1.3.10
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/package.json +14 -10
- package/src/data/TestClass.js +1 -1
- package/src/data/testValues.js +71 -17
- package/src/multiTest.js +5 -5
- package/src/testMethod.js +5 -5
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -0
- package/types/src/data/TestClass.d.ts +11 -0
- package/types/src/data/TestClass.d.ts.map +1 -0
- package/types/src/data/coercible.d.ts +7 -0
- package/types/src/data/coercible.d.ts.map +1 -0
- package/types/src/data/testData.d.ts +289 -0
- package/types/src/data/testData.d.ts.map +1 -0
- package/types/src/data/testValues.d.ts +26 -0
- package/types/src/data/testValues.d.ts.map +1 -0
- package/types/src/multiTest.d.ts +14 -0
- package/types/src/multiTest.d.ts.map +1 -0
- package/types/src/testCheck.d.ts +11 -0
- package/types/src/testCheck.d.ts.map +1 -0
- package/types/src/testEnforce.d.ts +12 -0
- package/types/src/testEnforce.d.ts.map +1 -0
- package/types/src/testMethod.d.ts +27 -0
- package/types/src/testMethod.d.ts.map +1 -0
- package/types/src/utility/difference.d.ts +3 -0
- package/types/src/utility/difference.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "type-enforcer-test-helper",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
4
4
|
"description": "Test data and helper functions for type-enforcer and addons",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
"url": "https://github.com/DarrenPaulWright/type-enforcer-test-helper/issues"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"types": "types/index.d.ts",
|
|
21
23
|
"files": [
|
|
24
|
+
"/types",
|
|
22
25
|
"/src"
|
|
23
26
|
],
|
|
24
27
|
"badges": {
|
|
@@ -46,32 +49,33 @@
|
|
|
46
49
|
}
|
|
47
50
|
},
|
|
48
51
|
"scripts": {
|
|
49
|
-
"test": "
|
|
50
|
-
"test-watch": "
|
|
52
|
+
"test": "",
|
|
53
|
+
"test-watch": "",
|
|
51
54
|
"preversion": "npm test && npm run docs && git add --all && git diff HEAD --quiet || git commit -m \"Updating docs\"",
|
|
52
55
|
"postversion": "npm publish",
|
|
53
56
|
"postpublish": "git push --follow-tags",
|
|
54
57
|
"pre-clean": "rm -rf node_modules && del /f package-lock.json",
|
|
55
58
|
"clean": "npm run pre-clean && npm install && npm audit fix",
|
|
56
|
-
"update": "ncu -u
|
|
59
|
+
"update": "ncu -u && git diff --quiet || npm install && npm audit fix",
|
|
57
60
|
"update-clean": "npm run pre-clean && npm run update",
|
|
58
61
|
"update-commit": "npm run update && npm test && git add --all && git diff HEAD --quiet || git commit -m \"Updating dependencies\"",
|
|
59
62
|
"update-patch": "npm run update && npm test && git add --all && git diff HEAD --quiet || git commit -m \"Updating dependencies\" && npm version patch",
|
|
60
63
|
"docs:readme": "jsdoc2md ./index.js src/**/*.js > README.md -t node_modules/dmd-readable/overview.hbs --plugin dmd-readable/overview-plugin.js",
|
|
61
64
|
"docs:main": "exec-each --out docs/{basefile}.md src/*.js jsdoc2md -- {path} -t node_modules/dmd-readable/docs.hbs --plugin dmd-readable",
|
|
62
65
|
"docs:data": "exec-each --out docs/{basefile}.md src/data/*.js jsdoc2md -- {path} -t node_modules/dmd-readable/docs.hbs --plugin dmd-readable",
|
|
66
|
+
"docs:types": "rm -rf types && tsc",
|
|
63
67
|
"docs": "run-p docs:*"
|
|
64
68
|
},
|
|
65
69
|
"dependencies": {
|
|
66
|
-
"display-value": "^
|
|
67
|
-
"object-agent": "^1.
|
|
68
|
-
"type-enforcer": "^1.2.
|
|
70
|
+
"display-value": "^2.2.0",
|
|
71
|
+
"object-agent": "^1.6.0",
|
|
72
|
+
"type-enforcer": "^1.2.4"
|
|
69
73
|
},
|
|
70
74
|
"devDependencies": {
|
|
71
75
|
"dmd-readable": "^1.2.4",
|
|
72
76
|
"exec-each": "0.0.3",
|
|
73
|
-
"jsdoc-to-markdown": "^
|
|
74
|
-
"
|
|
75
|
-
"
|
|
77
|
+
"jsdoc-to-markdown": "^8.0.0",
|
|
78
|
+
"npm-run-all": "^4.1.5",
|
|
79
|
+
"typescript": "^5.2.2"
|
|
76
80
|
}
|
|
77
81
|
}
|
package/src/data/TestClass.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @class TestClass
|
|
3
3
|
* @classdesc A simple class for testing things like instanceof
|
|
4
4
|
*
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {unknown} value - Adds a property "value" to an instance of TestClass, set to the value provided.
|
|
6
6
|
*/
|
|
7
7
|
export default class TestClass {
|
|
8
8
|
constructor(value) {
|
package/src/data/testValues.js
CHANGED
|
@@ -12,7 +12,15 @@ import TestClass from './TestClass.js';
|
|
|
12
12
|
* @constant {Array} validArrays
|
|
13
13
|
*/
|
|
14
14
|
const arrayReference = Array(3);
|
|
15
|
-
export const validArrays = [
|
|
15
|
+
export const validArrays = [
|
|
16
|
+
[1],
|
|
17
|
+
[2],
|
|
18
|
+
[],
|
|
19
|
+
new Array(),
|
|
20
|
+
new Array(12),
|
|
21
|
+
Array(),
|
|
22
|
+
arrayReference
|
|
23
|
+
];
|
|
16
24
|
|
|
17
25
|
/**
|
|
18
26
|
* Booleans instantiated in different ways or with different values.
|
|
@@ -20,7 +28,13 @@ export const validArrays = [[1], [2], [], new Array(), Array(), arrayReference];
|
|
|
20
28
|
* @constant {Array} validBooleans
|
|
21
29
|
*/
|
|
22
30
|
const booleanReference = Boolean();
|
|
23
|
-
export const validBooleans = [
|
|
31
|
+
export const validBooleans = [
|
|
32
|
+
true,
|
|
33
|
+
false,
|
|
34
|
+
new Boolean(true), // eslint-disable-line no-new-wrappers
|
|
35
|
+
Boolean(1),
|
|
36
|
+
booleanReference
|
|
37
|
+
];
|
|
24
38
|
|
|
25
39
|
/**
|
|
26
40
|
* Dates instantiated in different ways or with different values.
|
|
@@ -28,7 +42,10 @@ export const validBooleans = [true, false, new Boolean(true), booleanReference];
|
|
|
28
42
|
* @constant {Array} validDates
|
|
29
43
|
*/
|
|
30
44
|
const dateReference = new Date();
|
|
31
|
-
export const validDates = [
|
|
45
|
+
export const validDates = [
|
|
46
|
+
dateReference,
|
|
47
|
+
new Date('01/15/2010')
|
|
48
|
+
];
|
|
32
49
|
|
|
33
50
|
/**
|
|
34
51
|
* Functions instantiated in different ways.
|
|
@@ -37,13 +54,15 @@ export const validDates = [dateReference, new Date('01/15/2010')];
|
|
|
37
54
|
*/
|
|
38
55
|
const namedFunctionExpression = function() {
|
|
39
56
|
};
|
|
40
|
-
export const validFunctions = [
|
|
57
|
+
export const validFunctions = [
|
|
58
|
+
namedFunctionExpression,
|
|
41
59
|
function namedFunctionDeclaration() {
|
|
42
60
|
},
|
|
43
61
|
function() {
|
|
44
62
|
},
|
|
45
63
|
() => {
|
|
46
|
-
}
|
|
64
|
+
}
|
|
65
|
+
];
|
|
47
66
|
|
|
48
67
|
/**
|
|
49
68
|
* Different instances of TestClass with different values.
|
|
@@ -51,9 +70,11 @@ export const validFunctions = [namedFunctionExpression,
|
|
|
51
70
|
* @constant {Array} validInstances
|
|
52
71
|
*/
|
|
53
72
|
const classReference = new TestClass(1);
|
|
54
|
-
export const validInstances = [
|
|
73
|
+
export const validInstances = [
|
|
74
|
+
classReference,
|
|
55
75
|
new TestClass(1),
|
|
56
|
-
new TestClass(2)
|
|
76
|
+
new TestClass(2)
|
|
77
|
+
];
|
|
57
78
|
|
|
58
79
|
/**
|
|
59
80
|
* Integers instantiated in different ways or with different values.
|
|
@@ -61,7 +82,12 @@ export const validInstances = [classReference,
|
|
|
61
82
|
* @constant {Array} validIntegers
|
|
62
83
|
*/
|
|
63
84
|
const integerReference = Number(11);
|
|
64
|
-
export const validIntegers = [
|
|
85
|
+
export const validIntegers = [
|
|
86
|
+
1,
|
|
87
|
+
5,
|
|
88
|
+
new Number(42), // eslint-disable-line no-new-wrappers
|
|
89
|
+
integerReference
|
|
90
|
+
];
|
|
65
91
|
|
|
66
92
|
/**
|
|
67
93
|
* Floats instantiated in different ways or with different values.
|
|
@@ -69,12 +95,14 @@ export const validIntegers = [1, 5, new Number(42), integerReference]; // eslint
|
|
|
69
95
|
* @constant {Array} validFloats
|
|
70
96
|
*/
|
|
71
97
|
const floatReference = Number(11.3);
|
|
72
|
-
export const validFloats = [
|
|
98
|
+
export const validFloats = [
|
|
99
|
+
1.3,
|
|
73
100
|
2.5,
|
|
74
101
|
-10.00000001,
|
|
75
102
|
3.14159,
|
|
76
103
|
new Number(42.2), // eslint-disable-line no-new-wrappers
|
|
77
|
-
floatReference
|
|
104
|
+
floatReference
|
|
105
|
+
];
|
|
78
106
|
|
|
79
107
|
/**
|
|
80
108
|
* Infinity and -Infinity
|
|
@@ -82,7 +110,10 @@ export const validFloats = [1.3,
|
|
|
82
110
|
* @constant {Array} validInfinities
|
|
83
111
|
*/
|
|
84
112
|
const infinityReference = Infinity;
|
|
85
|
-
export const validInfinities = [
|
|
113
|
+
export const validInfinities = [
|
|
114
|
+
infinityReference,
|
|
115
|
+
-Infinity
|
|
116
|
+
];
|
|
86
117
|
|
|
87
118
|
/**
|
|
88
119
|
* An empty Map and a Map with data.
|
|
@@ -90,7 +121,10 @@ export const validInfinities = [infinityReference, -Infinity];
|
|
|
90
121
|
* @constant {Array} validMaps
|
|
91
122
|
*/
|
|
92
123
|
const mapReference = new Map().set('test', 12);
|
|
93
|
-
export const validMaps = [
|
|
124
|
+
export const validMaps = [
|
|
125
|
+
new Map(),
|
|
126
|
+
mapReference
|
|
127
|
+
];
|
|
94
128
|
|
|
95
129
|
/**
|
|
96
130
|
* Plain objects instantiated in different ways or with different values.
|
|
@@ -98,7 +132,12 @@ export const validMaps = [new Map(), mapReference];
|
|
|
98
132
|
* @constant {Array} validObjects
|
|
99
133
|
*/
|
|
100
134
|
const objectReference = Object();
|
|
101
|
-
export const validObjects = [
|
|
135
|
+
export const validObjects = [
|
|
136
|
+
{},
|
|
137
|
+
{ test1: 1 },
|
|
138
|
+
new Object(), // eslint-disable-line no-new-object
|
|
139
|
+
objectReference
|
|
140
|
+
];
|
|
102
141
|
|
|
103
142
|
/**
|
|
104
143
|
* A normal Promise and Promise.all.
|
|
@@ -118,7 +157,11 @@ export const validPromises = [
|
|
|
118
157
|
* @constant {Array} validRegExps
|
|
119
158
|
*/
|
|
120
159
|
const regExpReference = RegExp(); // eslint-disable-line require-unicode-regexp
|
|
121
|
-
export const validRegExps = [
|
|
160
|
+
export const validRegExps = [
|
|
161
|
+
/asdf/g, // eslint-disable-line require-unicode-regexp
|
|
162
|
+
new RegExp('test 2'), // eslint-disable-line require-unicode-regexp
|
|
163
|
+
regExpReference
|
|
164
|
+
];
|
|
122
165
|
|
|
123
166
|
/**
|
|
124
167
|
* An empty Set and a Set with data.
|
|
@@ -126,7 +169,10 @@ export const validRegExps = [/asdf/g, new RegExp('test 2'), regExpReference]; //
|
|
|
126
169
|
* @constant {Array} validSets
|
|
127
170
|
*/
|
|
128
171
|
const setReference = new Set([1, 2]);
|
|
129
|
-
export const validSets = [
|
|
172
|
+
export const validSets = [
|
|
173
|
+
new Set(),
|
|
174
|
+
setReference
|
|
175
|
+
];
|
|
130
176
|
|
|
131
177
|
/**
|
|
132
178
|
* Strings instantiated in different ways or with different values.
|
|
@@ -134,7 +180,12 @@ export const validSets = [new Set(), setReference];
|
|
|
134
180
|
* @constant {Array} validStrings
|
|
135
181
|
*/
|
|
136
182
|
const stringReference = String('test3');
|
|
137
|
-
export const validStrings = [
|
|
183
|
+
export const validStrings = [
|
|
184
|
+
'test',
|
|
185
|
+
'',
|
|
186
|
+
new String('test2'), // eslint-disable-line no-new-wrappers
|
|
187
|
+
stringReference
|
|
188
|
+
];
|
|
138
189
|
|
|
139
190
|
/**
|
|
140
191
|
* A Symbol with a label and one without.
|
|
@@ -150,7 +201,10 @@ export const validSymbols = [Symbol(), symbolReference];
|
|
|
150
201
|
* @constant {Array} validWeakMaps
|
|
151
202
|
*/
|
|
152
203
|
const weakMapReference = new WeakMap().set({}, 12);
|
|
153
|
-
export const validWeakMaps = [
|
|
204
|
+
export const validWeakMaps = [
|
|
205
|
+
new WeakMap(),
|
|
206
|
+
weakMapReference
|
|
207
|
+
];
|
|
154
208
|
|
|
155
209
|
/**
|
|
156
210
|
* An empty WeakSet and a WeakSet with data.
|
package/src/multiTest.js
CHANGED
|
@@ -7,13 +7,13 @@ const getMessage = (settings, assertion) => {
|
|
|
7
7
|
return settings.message;
|
|
8
8
|
}
|
|
9
9
|
if (assertion === 'true') {
|
|
10
|
-
return (input) => `should return true for ${displayValue(input)}`;
|
|
10
|
+
return (input) => `should return true for ${ displayValue(input) }`;
|
|
11
11
|
}
|
|
12
12
|
if (assertion === 'false') {
|
|
13
|
-
return (input) => `should return false for ${displayValue(input)}`;
|
|
13
|
+
return (input) => `should return false for ${ displayValue(input) }`;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
return (input, output) => `should return ${displayValue(output)} when set to ${input}`;
|
|
16
|
+
return (input, output) => `should return ${ displayValue(output) } when set to ${ input }`;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -29,7 +29,7 @@ const getMessage = (settings, assertion) => {
|
|
|
29
29
|
* @param {Function} [settings.message] - Provides two or three params, the input value(s) and the expected output value. Must return a string. It is recommended to use the display-value library on values for readability.
|
|
30
30
|
* @param {string} [settings.inputKey] - If values is an array of objects, this specifies which key to get the input value from.
|
|
31
31
|
* @param {string} [settings.outputKey] - If values is an array of objects, this specifies which key to get the expected output value from.
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {unknown} [settings.output] - The expected output value of all tests.
|
|
33
33
|
* @param {boolean} [settings.eachPair=false] - Values must be an array, runs tests on every combination of two items from values.
|
|
34
34
|
* @param {string} [settings.assertion='equal'] - The type-enforcer assert function to run against all tests.
|
|
35
35
|
*/
|
|
@@ -47,7 +47,7 @@ export default (settings) => {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const buildDoubleMessage = settings.message || ((input1, input2, output) => {
|
|
50
|
-
return `should return ${displayValue(output)} when ${displayValue(input1)} and ${displayValue(input2)} are provided`;
|
|
50
|
+
return `should return ${ displayValue(output) } when ${ displayValue(input1) } and ${ displayValue(input2) } are provided`;
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const testSingleValue = (input, output, value) => {
|
package/src/testMethod.js
CHANGED
|
@@ -35,8 +35,8 @@ const getSymbol = Symbol();
|
|
|
35
35
|
* @param {Array} settings.true - An array of values that are valid for this method.
|
|
36
36
|
* @param {Array} settings.false - An array of values that are NOT valid for this method.
|
|
37
37
|
* @param {Array|false} [settings.coerce] - An array of objects with values that can be coerced by this method.
|
|
38
|
-
* @param {
|
|
39
|
-
* @param {
|
|
38
|
+
* @param {unknown} settings.coerce[].value - The value to be coerced.
|
|
39
|
+
* @param {unknown} settings.coerce[].coerced - The expected result of coercion.
|
|
40
40
|
* @param {Array} settings.coerceTrue - Alternatively, an array of values that are coercible by this method.
|
|
41
41
|
* @param {Function} thisMethod - The function to test.
|
|
42
42
|
* @param {object} method - An object that includes this function.
|
|
@@ -367,7 +367,7 @@ export default function(settings, thisMethod, method) {
|
|
|
367
367
|
runTests(TestConstructor2, settings.true[0], settings.true[1], settings.coerce || []);
|
|
368
368
|
|
|
369
369
|
settings.false.forEach((falseValue) => {
|
|
370
|
-
it(`should return ${displayValue(settings.true[0])} after attempting to set to ${displayValue(falseValue)}`, () => {
|
|
370
|
+
it(`should return ${ displayValue(settings.true[0]) } after attempting to set to ${ displayValue(falseValue) }`, () => {
|
|
371
371
|
const testConstructor = new TestConstructor2();
|
|
372
372
|
|
|
373
373
|
testConstructor.testMethod(falseValue);
|
|
@@ -406,7 +406,7 @@ export default function(settings, thisMethod, method) {
|
|
|
406
406
|
});
|
|
407
407
|
|
|
408
408
|
settings.coerceTrue.forEach((value) => {
|
|
409
|
-
it(`should return coerced ${displayValue(value)} after attempting to set to ${displayValue(value)}`, () => {
|
|
409
|
+
it(`should return coerced ${ displayValue(value) } after attempting to set to ${ displayValue(value) }`, () => {
|
|
410
410
|
const testConstructor = new TestConstructor2();
|
|
411
411
|
|
|
412
412
|
testConstructor.testMethod(value);
|
|
@@ -426,7 +426,7 @@ export default function(settings, thisMethod, method) {
|
|
|
426
426
|
});
|
|
427
427
|
|
|
428
428
|
settings.coerceTrue.forEach((value) => {
|
|
429
|
-
it(`should return coerced ${displayValue(value)} after attempting to set to ${displayValue(value)}`, () => {
|
|
429
|
+
it(`should return coerced ${ displayValue(value) } after attempting to set to ${ displayValue(value) }`, () => {
|
|
430
430
|
const testConstructor = new TestConstructor2();
|
|
431
431
|
|
|
432
432
|
testConstructor.testMethod(value);
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./src/data/testValues.js";
|
|
2
|
+
export * from "./src/data/testData.js";
|
|
3
|
+
export { default as TestClass } from "./src/data/TestClass.js";
|
|
4
|
+
export { default as multiTest } from "./src/multiTest.js";
|
|
5
|
+
export { default as testCheck } from "./src/testCheck.js";
|
|
6
|
+
export { default as testEnforce } from "./src/testEnforce.js";
|
|
7
|
+
export { default as testMethod } from "./src/testMethod.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class TestClass
|
|
3
|
+
* @classdesc A simple class for testing things like instanceof
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} value - Adds a property "value" to an instance of TestClass, set to the value provided.
|
|
6
|
+
*/
|
|
7
|
+
export default class TestClass {
|
|
8
|
+
constructor(value: any);
|
|
9
|
+
value: any;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=TestClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestClass.d.ts","sourceRoot":"","sources":["../../../src/data/TestClass.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;IACC,wBAEC;IADA,WAAkB;CAEnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const coerceArrayTrue: string[];
|
|
2
|
+
export const coerceInfinity: string[];
|
|
3
|
+
export const coerceIntegerTrue: string[];
|
|
4
|
+
export const coerceFloatTrue: string[];
|
|
5
|
+
export const coerceNumberFalse: (string | number)[];
|
|
6
|
+
export const coerceObjectTrue: string[];
|
|
7
|
+
//# sourceMappingURL=coercible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coercible.d.ts","sourceRoot":"","sources":["../../../src/data/coercible.js"],"names":[],"mappings":"AAAA,uCAAkD;AAElD,sCAGE;AAEF,yCAuBO;AAEP,uCAGE;AAEF,oDA6CE;AAEF,wCAA0D"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
export namespace arrayData {
|
|
2
|
+
export let value: ArrayConstructor;
|
|
3
|
+
export let name: string;
|
|
4
|
+
export { validArrays as true };
|
|
5
|
+
let _false: any;
|
|
6
|
+
export { _false as false };
|
|
7
|
+
export { coerceArrayTrue as coerceTrue };
|
|
8
|
+
export let coerceFalse: any;
|
|
9
|
+
}
|
|
10
|
+
export namespace booleanData {
|
|
11
|
+
let value_1: BooleanConstructor;
|
|
12
|
+
export { value_1 as value };
|
|
13
|
+
let name_1: string;
|
|
14
|
+
export { name_1 as name };
|
|
15
|
+
export { validBooleans as true };
|
|
16
|
+
let _false_1: any;
|
|
17
|
+
export { _false_1 as false };
|
|
18
|
+
export let coerceTrue: any;
|
|
19
|
+
let coerceFalse_1: any[];
|
|
20
|
+
export { coerceFalse_1 as coerceFalse };
|
|
21
|
+
}
|
|
22
|
+
export namespace dateData {
|
|
23
|
+
let value_2: DateConstructor;
|
|
24
|
+
export { value_2 as value };
|
|
25
|
+
let name_2: string;
|
|
26
|
+
export { name_2 as name };
|
|
27
|
+
export { validDates as true };
|
|
28
|
+
let _false_2: any;
|
|
29
|
+
export { _false_2 as false };
|
|
30
|
+
let coerceTrue_1: string[];
|
|
31
|
+
export { coerceTrue_1 as coerceTrue };
|
|
32
|
+
let coerceFalse_2: any;
|
|
33
|
+
export { coerceFalse_2 as coerceFalse };
|
|
34
|
+
}
|
|
35
|
+
export namespace functionData {
|
|
36
|
+
let value_3: FunctionConstructor;
|
|
37
|
+
export { value_3 as value };
|
|
38
|
+
let name_3: string;
|
|
39
|
+
export { name_3 as name };
|
|
40
|
+
export { validFunctions as true };
|
|
41
|
+
let _false_3: any;
|
|
42
|
+
export { _false_3 as false };
|
|
43
|
+
let coerceTrue_2: any[];
|
|
44
|
+
export { coerceTrue_2 as coerceTrue };
|
|
45
|
+
let coerceFalse_3: any;
|
|
46
|
+
export { coerceFalse_3 as coerceFalse };
|
|
47
|
+
}
|
|
48
|
+
export namespace instanceData {
|
|
49
|
+
export { TestClass as value };
|
|
50
|
+
let name_4: string;
|
|
51
|
+
export { name_4 as name };
|
|
52
|
+
export { validInstances as true };
|
|
53
|
+
let _false_4: any;
|
|
54
|
+
export { _false_4 as false };
|
|
55
|
+
let coerceTrue_3: any[];
|
|
56
|
+
export { coerceTrue_3 as coerceTrue };
|
|
57
|
+
let coerceFalse_4: any[];
|
|
58
|
+
export { coerceFalse_4 as coerceFalse };
|
|
59
|
+
}
|
|
60
|
+
export namespace integerData {
|
|
61
|
+
let name_5: string;
|
|
62
|
+
export { name_5 as name };
|
|
63
|
+
export let skip: string[];
|
|
64
|
+
export { validIntegers as true };
|
|
65
|
+
let _false_5: any;
|
|
66
|
+
export { _false_5 as false };
|
|
67
|
+
export { coerceIntegerTrue as coerceTrue };
|
|
68
|
+
let coerceFalse_5: (string | number)[];
|
|
69
|
+
export { coerceFalse_5 as coerceFalse };
|
|
70
|
+
}
|
|
71
|
+
export namespace jsonData {
|
|
72
|
+
let name_6: string;
|
|
73
|
+
export { name_6 as name };
|
|
74
|
+
let _true: string[];
|
|
75
|
+
export { _true as true };
|
|
76
|
+
let _false_6: string[];
|
|
77
|
+
export { _false_6 as false };
|
|
78
|
+
let coerceTrue_4: any[];
|
|
79
|
+
export { coerceTrue_4 as coerceTrue };
|
|
80
|
+
let coerceFalse_6: any[];
|
|
81
|
+
export { coerceFalse_6 as coerceFalse };
|
|
82
|
+
}
|
|
83
|
+
export namespace floatData {
|
|
84
|
+
let name_7: string;
|
|
85
|
+
export { name_7 as name };
|
|
86
|
+
let skip_1: string[];
|
|
87
|
+
export { skip_1 as skip };
|
|
88
|
+
export { validFloats as true };
|
|
89
|
+
let _false_7: any;
|
|
90
|
+
export { _false_7 as false };
|
|
91
|
+
let coerceTrue_5: string[];
|
|
92
|
+
export { coerceTrue_5 as coerceTrue };
|
|
93
|
+
let coerceFalse_7: (string | number)[];
|
|
94
|
+
export { coerceFalse_7 as coerceFalse };
|
|
95
|
+
}
|
|
96
|
+
export namespace numberData {
|
|
97
|
+
let value_4: NumberConstructor;
|
|
98
|
+
export { value_4 as value };
|
|
99
|
+
let name_8: string;
|
|
100
|
+
export { name_8 as name };
|
|
101
|
+
let skip_2: string[];
|
|
102
|
+
export { skip_2 as skip };
|
|
103
|
+
let _true_1: (number | Number)[];
|
|
104
|
+
export { _true_1 as true };
|
|
105
|
+
let _false_8: any;
|
|
106
|
+
export { _false_8 as false };
|
|
107
|
+
let coerceTrue_6: string[];
|
|
108
|
+
export { coerceTrue_6 as coerceTrue };
|
|
109
|
+
export { coerceNumberFalse as coerceFalse };
|
|
110
|
+
}
|
|
111
|
+
export namespace mapData {
|
|
112
|
+
let value_5: any;
|
|
113
|
+
export { value_5 as value };
|
|
114
|
+
let name_9: string;
|
|
115
|
+
export { name_9 as name };
|
|
116
|
+
export { validMaps as true };
|
|
117
|
+
let _false_9: any;
|
|
118
|
+
export { _false_9 as false };
|
|
119
|
+
let coerceTrue_7: string[];
|
|
120
|
+
export { coerceTrue_7 as coerceTrue };
|
|
121
|
+
let coerceFalse_8: any;
|
|
122
|
+
export { coerceFalse_8 as coerceFalse };
|
|
123
|
+
}
|
|
124
|
+
export namespace objectData {
|
|
125
|
+
let value_6: ObjectConstructor;
|
|
126
|
+
export { value_6 as value };
|
|
127
|
+
let name_10: string;
|
|
128
|
+
export { name_10 as name };
|
|
129
|
+
export { validObjects as true };
|
|
130
|
+
let _false_10: boolean[];
|
|
131
|
+
export { _false_10 as false };
|
|
132
|
+
export { coerceObjectTrue as coerceTrue };
|
|
133
|
+
export { validStrings as coerceFalse };
|
|
134
|
+
}
|
|
135
|
+
export namespace promiseData {
|
|
136
|
+
let value_7: any;
|
|
137
|
+
export { value_7 as value };
|
|
138
|
+
let name_11: string;
|
|
139
|
+
export { name_11 as name };
|
|
140
|
+
export { validPromises as true };
|
|
141
|
+
let _false_11: any;
|
|
142
|
+
export { _false_11 as false };
|
|
143
|
+
export { validFunctions as coerceTrue };
|
|
144
|
+
let coerceFalse_9: any;
|
|
145
|
+
export { coerceFalse_9 as coerceFalse };
|
|
146
|
+
}
|
|
147
|
+
export namespace regExpData {
|
|
148
|
+
let value_8: RegExpConstructor;
|
|
149
|
+
export { value_8 as value };
|
|
150
|
+
let name_12: string;
|
|
151
|
+
export { name_12 as name };
|
|
152
|
+
export { validRegExps as true };
|
|
153
|
+
let _false_12: any;
|
|
154
|
+
export { _false_12 as false };
|
|
155
|
+
let coerceTrue_8: string[];
|
|
156
|
+
export { coerceTrue_8 as coerceTrue };
|
|
157
|
+
let coerceFalse_10: any;
|
|
158
|
+
export { coerceFalse_10 as coerceFalse };
|
|
159
|
+
}
|
|
160
|
+
export namespace setData {
|
|
161
|
+
let value_9: any;
|
|
162
|
+
export { value_9 as value };
|
|
163
|
+
let name_13: string;
|
|
164
|
+
export { name_13 as name };
|
|
165
|
+
export { validSets as true };
|
|
166
|
+
let _false_13: any;
|
|
167
|
+
export { _false_13 as false };
|
|
168
|
+
let coerceTrue_9: any[][];
|
|
169
|
+
export { coerceTrue_9 as coerceTrue };
|
|
170
|
+
let coerceFalse_11: any;
|
|
171
|
+
export { coerceFalse_11 as coerceFalse };
|
|
172
|
+
}
|
|
173
|
+
export namespace stringData {
|
|
174
|
+
let value_10: StringConstructor;
|
|
175
|
+
export { value_10 as value };
|
|
176
|
+
let name_14: string;
|
|
177
|
+
export { name_14 as name };
|
|
178
|
+
export { validStrings as true };
|
|
179
|
+
let _false_14: any;
|
|
180
|
+
export { _false_14 as false };
|
|
181
|
+
let coerceTrue_10: any;
|
|
182
|
+
export { coerceTrue_10 as coerceTrue };
|
|
183
|
+
let coerceFalse_12: any[];
|
|
184
|
+
export { coerceFalse_12 as coerceFalse };
|
|
185
|
+
}
|
|
186
|
+
export namespace symbolData {
|
|
187
|
+
let value_11: any;
|
|
188
|
+
export { value_11 as value };
|
|
189
|
+
let name_15: string;
|
|
190
|
+
export { name_15 as name };
|
|
191
|
+
export { validSymbols as true };
|
|
192
|
+
let _false_15: any;
|
|
193
|
+
export { _false_15 as false };
|
|
194
|
+
import coerceTrue_11 = stringData.coerceTrue;
|
|
195
|
+
export { coerceTrue_11 as coerceTrue };
|
|
196
|
+
import coerceFalse_13 = stringData.coerceFalse;
|
|
197
|
+
export { coerceFalse_13 as coerceFalse };
|
|
198
|
+
}
|
|
199
|
+
export namespace weakMapData {
|
|
200
|
+
let value_12: any;
|
|
201
|
+
export { value_12 as value };
|
|
202
|
+
let name_16: string;
|
|
203
|
+
export { name_16 as name };
|
|
204
|
+
export { validWeakMaps as true };
|
|
205
|
+
let _false_16: any;
|
|
206
|
+
export { _false_16 as false };
|
|
207
|
+
let coerceTrue_12: ((number | typeof TestClass)[] | (string | typeof TestClass)[])[][];
|
|
208
|
+
export { coerceTrue_12 as coerceTrue };
|
|
209
|
+
let coerceFalse_14: any;
|
|
210
|
+
export { coerceFalse_14 as coerceFalse };
|
|
211
|
+
}
|
|
212
|
+
export namespace weakSetData {
|
|
213
|
+
let value_13: any;
|
|
214
|
+
export { value_13 as value };
|
|
215
|
+
let name_17: string;
|
|
216
|
+
export { name_17 as name };
|
|
217
|
+
export { validWeakSets as true };
|
|
218
|
+
let _false_17: any;
|
|
219
|
+
export { _false_17 as false };
|
|
220
|
+
let coerceTrue_13: TestClass[][];
|
|
221
|
+
export { coerceTrue_13 as coerceTrue };
|
|
222
|
+
let coerceFalse_15: any;
|
|
223
|
+
export { coerceFalse_15 as coerceFalse };
|
|
224
|
+
}
|
|
225
|
+
export const testTypes: ({
|
|
226
|
+
value: FunctionConstructor;
|
|
227
|
+
name: string;
|
|
228
|
+
true: (() => void)[];
|
|
229
|
+
false: any;
|
|
230
|
+
coerceTrue: any[];
|
|
231
|
+
coerceFalse: any;
|
|
232
|
+
} | {
|
|
233
|
+
name: string;
|
|
234
|
+
skip: string[];
|
|
235
|
+
true: (number | Number)[];
|
|
236
|
+
false: any;
|
|
237
|
+
coerceTrue: string[];
|
|
238
|
+
coerceFalse: (string | number)[];
|
|
239
|
+
} | {
|
|
240
|
+
value: any;
|
|
241
|
+
name: string;
|
|
242
|
+
true: any[];
|
|
243
|
+
false: any;
|
|
244
|
+
coerceTrue: string[];
|
|
245
|
+
coerceFalse: any;
|
|
246
|
+
} | {
|
|
247
|
+
value: any;
|
|
248
|
+
name: string;
|
|
249
|
+
true: any[];
|
|
250
|
+
false: any;
|
|
251
|
+
coerceTrue: (() => void)[];
|
|
252
|
+
coerceFalse: any;
|
|
253
|
+
} | {
|
|
254
|
+
value: any;
|
|
255
|
+
name: string;
|
|
256
|
+
true: any[];
|
|
257
|
+
false: any;
|
|
258
|
+
coerceTrue: any[][];
|
|
259
|
+
coerceFalse: any;
|
|
260
|
+
} | {
|
|
261
|
+
value: any;
|
|
262
|
+
name: string;
|
|
263
|
+
true: any[];
|
|
264
|
+
false: any;
|
|
265
|
+
coerceTrue: any;
|
|
266
|
+
coerceFalse: any[];
|
|
267
|
+
})[];
|
|
268
|
+
import { validArrays } from './testValues.js';
|
|
269
|
+
import { coerceArrayTrue } from './coercible.js';
|
|
270
|
+
import { validBooleans } from './testValues.js';
|
|
271
|
+
import { validDates } from './testValues.js';
|
|
272
|
+
import { validFunctions } from './testValues.js';
|
|
273
|
+
import TestClass from './TestClass.js';
|
|
274
|
+
import { validInstances } from './testValues.js';
|
|
275
|
+
import { validIntegers } from './testValues.js';
|
|
276
|
+
import { coerceIntegerTrue } from './coercible.js';
|
|
277
|
+
import { validFloats } from './testValues.js';
|
|
278
|
+
import { coerceNumberFalse } from './coercible.js';
|
|
279
|
+
import { validMaps } from './testValues.js';
|
|
280
|
+
import { validObjects } from './testValues.js';
|
|
281
|
+
import { coerceObjectTrue } from './coercible.js';
|
|
282
|
+
import { validStrings } from './testValues.js';
|
|
283
|
+
import { validPromises } from './testValues.js';
|
|
284
|
+
import { validRegExps } from './testValues.js';
|
|
285
|
+
import { validSets } from './testValues.js';
|
|
286
|
+
import { validSymbols } from './testValues.js';
|
|
287
|
+
import { validWeakMaps } from './testValues.js';
|
|
288
|
+
import { validWeakSets } from './testValues.js';
|
|
289
|
+
//# sourceMappingURL=testData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testData.d.ts","sourceRoot":"","sources":["../../../src/data/testData.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8YA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkBE;4BAnYK,iBAAiB;gCArBjB,gBAAgB;8BAqBhB,iBAAiB;2BAAjB,iBAAiB;+BAAjB,iBAAiB;sBApBF,gBAAgB;+BAoB/B,iBAAiB;8BAAjB,iBAAiB;kCArBjB,gBAAgB;4BAqBhB,iBAAiB;kCArBjB,gBAAgB;0BAqBhB,iBAAiB;6BAAjB,iBAAiB;iCArBjB,gBAAgB;6BAqBhB,iBAAiB;8BAAjB,iBAAiB;6BAAjB,iBAAiB;0BAAjB,iBAAiB;6BAAjB,iBAAiB;8BAAjB,iBAAiB;8BAAjB,iBAAiB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const validArrays: any[][];
|
|
2
|
+
export const validBooleans: (boolean | Boolean)[];
|
|
3
|
+
export const validDates: Date[];
|
|
4
|
+
export const validFunctions: (() => void)[];
|
|
5
|
+
export const validInstances: TestClass[];
|
|
6
|
+
export const validIntegers: (number | Number)[];
|
|
7
|
+
export const validFloats: (number | Number)[];
|
|
8
|
+
export const validInfinities: number[];
|
|
9
|
+
export const validMaps: any[];
|
|
10
|
+
export const validObjects: any[];
|
|
11
|
+
export const validPromises: any[];
|
|
12
|
+
export const validRegExps: RegExp[];
|
|
13
|
+
export const validSets: any[];
|
|
14
|
+
export const validStrings: (string | String)[];
|
|
15
|
+
export const validSymbols: any[];
|
|
16
|
+
export const validWeakMaps: any[];
|
|
17
|
+
export const validWeakSets: any[];
|
|
18
|
+
/**
|
|
19
|
+
* Undefined, null, and NaN
|
|
20
|
+
*
|
|
21
|
+
* @constant {Array} validNots
|
|
22
|
+
*/
|
|
23
|
+
export const validNots: number[];
|
|
24
|
+
export const testValues: number[];
|
|
25
|
+
import TestClass from './TestClass.js';
|
|
26
|
+
//# sourceMappingURL=testValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testValues.d.ts","sourceRoot":"","sources":["../../../src/data/testValues.js"],"names":[],"mappings":"AAcA,kCAQE;AAQF,kDAME;AAQF,gCAGE;AASF,4CAQE;AAQF,yCAIE;AAQF,gDAKE;AAQF,8CAOE;AAQF,uCAGE;AAQF,8BAGE;AAQF,iCAKE;AAQF,kCAIE;AAQF,oCAIE;AAQF,8BAGE;AAQF,+CAKE;AAQF,iCAAwD;AAQxD,kCAGE;AAQF,kCAA+D;AAE/D;;;;GAIG;AACH,iCAAgD;AAEhD,kCAiBE;sBAhPoB,gBAAgB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare function _default(settings: {
|
|
2
|
+
values: object | any[];
|
|
3
|
+
values2?: object | any[];
|
|
4
|
+
test: Function;
|
|
5
|
+
filter?: Function;
|
|
6
|
+
message?: Function;
|
|
7
|
+
inputKey?: string;
|
|
8
|
+
outputKey?: string;
|
|
9
|
+
output?: unknown;
|
|
10
|
+
eachPair?: boolean;
|
|
11
|
+
assertion?: string;
|
|
12
|
+
}): void;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=multiTest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiTest.d.ts","sourceRoot":"","sources":["../../src/multiTest.js"],"names":[],"mappings":"AAmCe;IAXqB,MAAM,EAA/B,MAAM,QAAQ;IACY,OAAO,GAAjC,MAAM,QAAQ;IACS,IAAI;IACH,MAAM;IACN,OAAO;IACP,QAAQ,GAAhC,MAAM;IACkB,SAAS,GAAjC,MAAM;IACwB,MAAM,GAApC,OAAO;IACiB,QAAQ,GAAhC,OAAO;IACiB,SAAS,GAAjC,MAAM;SA2FhB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test a type-enforcer check function (isArray, isBoolean, etc.).
|
|
3
|
+
*
|
|
4
|
+
* @function testCheck
|
|
5
|
+
*
|
|
6
|
+
* @param {object} data - A data object (arrayData, booleanData, etc.).
|
|
7
|
+
* @param {Function} check - The function to test.
|
|
8
|
+
* @param {object} is - An object that includes this function.
|
|
9
|
+
*/
|
|
10
|
+
export default function _default(data: object, check: Function, is: object): void;
|
|
11
|
+
//# sourceMappingURL=testCheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testCheck.d.ts","sourceRoot":"","sources":["../../src/testCheck.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,uCAJW,MAAM,uBAEN,MAAM,QAwDhB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test an enforce function (enforceArray, enforceBoolean, etc.).
|
|
3
|
+
*
|
|
4
|
+
* @function testEnforce
|
|
5
|
+
*
|
|
6
|
+
* @param {object} data - A data object (arrayData, booleanData, etc.).
|
|
7
|
+
* @param {Function} enforcer - The function to test.
|
|
8
|
+
* @param {object} enforce - An object that includes this function.
|
|
9
|
+
* @param {Function} coercer - A function that does a coercion just like this function.
|
|
10
|
+
*/
|
|
11
|
+
export default function _default(data: object, enforcer: Function, enforce: object, coercer: Function): void;
|
|
12
|
+
//# sourceMappingURL=testEnforce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testEnforce.d.ts","sourceRoot":"","sources":["../../src/testEnforce.js"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,uCALW,MAAM,+BAEN,MAAM,2BAiIhB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test a chainable method function (methodArray, methodBoolean, etc.).
|
|
3
|
+
*
|
|
4
|
+
* @function testMethod
|
|
5
|
+
*
|
|
6
|
+
* @param {object} settings - Settings object.
|
|
7
|
+
* @param {object} settings.name - The name used in type-enforcer namespaces for this type.
|
|
8
|
+
* @param {object} settings.init - The expected value returned by the method immediately after instantiation.
|
|
9
|
+
* @param {object} settings.extraProps - An object of extra properties to be passed in when the method is instantiated.
|
|
10
|
+
* @param {Array} settings.true - An array of values that are valid for this method.
|
|
11
|
+
* @param {Array} settings.false - An array of values that are NOT valid for this method.
|
|
12
|
+
* @param {Array|false} [settings.coerce] - An array of objects with values that can be coerced by this method.
|
|
13
|
+
* @param {unknown} settings.coerce[].value - The value to be coerced.
|
|
14
|
+
* @param {unknown} settings.coerce[].coerced - The expected result of coercion.
|
|
15
|
+
* @param {Array} settings.coerceTrue - Alternatively, an array of values that are coercible by this method.
|
|
16
|
+
* @param {Function} thisMethod - The function to test.
|
|
17
|
+
* @param {object} method - An object that includes this function.
|
|
18
|
+
*/
|
|
19
|
+
export default function _default(settings: {
|
|
20
|
+
name: object;
|
|
21
|
+
init: object;
|
|
22
|
+
extraProps: object;
|
|
23
|
+
true: any[];
|
|
24
|
+
false: any[];
|
|
25
|
+
coerce?: any[] | false;
|
|
26
|
+
}, thisMethod: Function, method: object): void;
|
|
27
|
+
//# sourceMappingURL=testMethod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testMethod.d.ts","sourceRoot":"","sources":["../../src/testMethod.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;GAiBG;AACH;IAZ4B,IAAI,EAArB,MAAM;IACW,IAAI,EAArB,MAAM;IACW,UAAU,EAA3B,MAAM;IACU,IAAI;IACJ,KAAK;IACE,MAAM,GAA7B,QAAM,KAAK;iCAKX,MAAM,QA6YhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../../src/utility/difference.js"],"names":[],"mappings":"AAAe,4DAGd"}
|