vest 4.5.0 → 4.6.2-dev-fcaa09
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/dist/cjs/enforce_compose.development.js +2 -0
- package/dist/cjs/enforce_compose.js +7 -0
- package/dist/cjs/enforce_compose.production.js +1 -0
- package/dist/cjs/enforce_compounds.development.js +4 -0
- package/dist/cjs/enforce_compounds.js +7 -0
- package/dist/cjs/enforce_compounds.production.js +1 -0
- package/dist/cjs/enforce_schema.development.js +4 -0
- package/dist/cjs/enforce_schema.js +7 -0
- package/dist/cjs/enforce_schema.production.js +1 -0
- package/dist/cjs/vest.development.js +149 -168
- package/dist/cjs/vest.production.js +1 -1
- package/dist/es/enforce_compose.development.js +1 -0
- package/dist/es/enforce_compose.production.js +1 -0
- package/dist/es/enforce_compounds.development.js +1 -0
- package/dist/es/enforce_compounds.production.js +1 -0
- package/dist/es/enforce_schema.development.js +1 -0
- package/dist/es/enforce_schema.production.js +1 -0
- package/dist/es/vest.development.js +150 -169
- package/dist/es/vest.production.js +1 -1
- package/dist/umd/classnames.development.js +11 -59
- package/dist/umd/classnames.production.js +1 -1
- package/dist/umd/enforce_compose.development.js +8 -0
- package/dist/umd/enforce_compose.production.js +1 -0
- package/dist/umd/enforce_compounds.development.js +8 -0
- package/dist/umd/enforce_compounds.production.js +1 -0
- package/dist/umd/enforce_schema.development.js +8 -0
- package/dist/umd/enforce_schema.production.js +1 -0
- package/dist/umd/parser.development.js +10 -58
- package/dist/umd/parser.production.js +1 -1
- package/dist/umd/promisify.development.js +5 -31
- package/dist/umd/promisify.production.js +1 -1
- package/dist/umd/vest.development.js +253 -1066
- package/dist/umd/vest.production.js +1 -1
- package/enforce_compose/package.json +9 -0
- package/enforce_compounds/package.json +9 -0
- package/enforce_schema/package.json +9 -0
- package/package.json +80 -79
- package/tsconfig.json +85 -1
- package/types/classnames.d.ts +1 -0
- package/types/classnames.d.ts.map +1 -0
- package/types/enforce_compose.d.ts +2 -0
- package/types/enforce_compose.d.ts.map +1 -0
- package/types/enforce_compounds.d.ts +2 -0
- package/types/enforce_compounds.d.ts.map +1 -0
- package/types/enforce_schema.d.ts +2 -0
- package/types/enforce_schema.d.ts.map +1 -0
- package/types/parser.d.ts +1 -0
- package/types/parser.d.ts.map +1 -0
- package/types/promisify.d.ts +1 -0
- package/types/promisify.d.ts.map +1 -0
- package/types/vest.d.ts +40 -37
- package/types/vest.d.ts.map +1 -0
- package/dist/cjs/compose.js +0 -7
- package/dist/cjs/compounds.js +0 -7
- package/dist/cjs/enforce/compose.development.js +0 -60
- package/dist/cjs/enforce/compose.production.js +0 -1
- package/dist/cjs/enforce/compounds.development.js +0 -92
- package/dist/cjs/enforce/compounds.production.js +0 -1
- package/dist/cjs/enforce/package.json +0 -1
- package/dist/cjs/enforce/schema.development.js +0 -92
- package/dist/cjs/enforce/schema.production.js +0 -1
- package/dist/cjs/schema.js +0 -7
- package/dist/es/enforce/compose.development.js +0 -58
- package/dist/es/enforce/compose.production.js +0 -1
- package/dist/es/enforce/compounds.development.js +0 -90
- package/dist/es/enforce/compounds.production.js +0 -1
- package/dist/es/enforce/package.json +0 -1
- package/dist/es/enforce/schema.development.js +0 -88
- package/dist/es/enforce/schema.production.js +0 -1
- package/dist/umd/enforce/compose.development.js +0 -736
- package/dist/umd/enforce/compose.production.js +0 -1
- package/dist/umd/enforce/compounds.development.js +0 -762
- package/dist/umd/enforce/compounds.production.js +0 -1
- package/dist/umd/enforce/schema.development.js +0 -768
- package/dist/umd/enforce/schema.production.js +0 -1
- package/enforce/compose/package.json +0 -9
- package/enforce/compounds/package.json +0 -9
- package/enforce/schema/package.json +0 -9
- package/types/enforce/compose.d.ts +0 -126
- package/types/enforce/compounds.d.ts +0 -138
- package/types/enforce/schema.d.ts +0 -143
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vest")):"function"==typeof define&&define.amd?define(["vest"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).classnames=e(t.vest)}(this,(function(t
|
|
1
|
+
"use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vest-utils"),require("vest")):"function"==typeof define&&define.amd?define(["vest-utils","vest"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).classnames=e(t["vest-utils"],t.vest)}(this,(function(t,e){return function(s,n){void 0===n&&(n={});var i=function(s){t.invariant(s&&t.hasOwnProperty(s,"valid"),"Vest parser: expected argument at position 0 to be Vest's result object.");var n=e.suiteSelectors(s),i={},r={invalid:n.hasErrors,tested:function(e){return e?t.hasOwnProperty(i,e)?i[e]:(i[e]=t.hasOwnProperty(s.tests,e)&&t.isPositive(s.tests[e].testCount),r.tested(e)):t.isPositive(s.testCount)},untested:function(e){return!(t.isPositive(s.testCount)&&r.tested(e))},valid:n.isValid,warning:n.hasWarnings};return r}(s);return function(e){var s,r=[];for(s in n){var o=s;t.isFunction(i[o])&&i[o](e)&&r.push(n[o])}return r.join(" ")}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";!function(n){"function"==typeof define&&define.amd&&define(n)}((function(){}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";!function(n){"function"==typeof define&&define.amd&&define(["n4s/compounds"],n)}((function(){}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";!function(n){"function"==typeof define&&define.amd&&define(["n4s/schema"],n)}((function(){}));
|
|
@@ -1,60 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vest')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vest'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.parser = {}, global.vest));
|
|
5
|
-
}(this, (function (exports, vest) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function isNumeric(value) {
|
|
8
|
-
var str = String(value);
|
|
9
|
-
var num = Number(value);
|
|
10
|
-
var result = !isNaN(parseFloat(str)) && !isNaN(Number(value)) && isFinite(num);
|
|
11
|
-
return Boolean(result);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function greaterThan(value, gt) {
|
|
15
|
-
return isNumeric(value) && isNumeric(gt) && Number(value) > Number(gt);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function isFunction(value) {
|
|
19
|
-
return typeof value === 'function';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function optionalFunctionValue(value) {
|
|
23
|
-
var args = [];
|
|
24
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
25
|
-
args[_i - 1] = arguments[_i];
|
|
26
|
-
}
|
|
27
|
-
return isFunction(value) ? value.apply(void 0, args) : value;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* A safe hasOwnProperty access
|
|
32
|
-
*/
|
|
33
|
-
function hasOwnProperty(obj, key) {
|
|
34
|
-
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function invariant(condition,
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
39
|
-
message) {
|
|
40
|
-
if (condition) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
// If message is a string object (rather than string literal)
|
|
44
|
-
// Throw the value directly as a string
|
|
45
|
-
// Alternatively, throw an error with the message
|
|
46
|
-
throw message instanceof String
|
|
47
|
-
? message.valueOf()
|
|
48
|
-
: new Error(message ? optionalFunctionValue(message) : message);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function isPositive(value) {
|
|
52
|
-
return greaterThan(value, 0);
|
|
53
|
-
}
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vest'), require('vest-utils')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vest', 'vest-utils'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.parser = {}, global.vest, global['vest-utils']));
|
|
5
|
+
}(this, (function (exports, vest, vestUtils) { 'use strict';
|
|
54
6
|
|
|
55
7
|
// eslint-disable-next-line max-statements
|
|
56
8
|
function parse(summary) {
|
|
57
|
-
invariant(summary && hasOwnProperty(summary, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
|
|
9
|
+
vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
|
|
58
10
|
var sel = vest.suiteSelectors(summary);
|
|
59
11
|
var testedStorage = {};
|
|
60
12
|
var selectors = {
|
|
@@ -68,17 +20,17 @@
|
|
|
68
20
|
// Booleans
|
|
69
21
|
function isTested(fieldName) {
|
|
70
22
|
if (!fieldName) {
|
|
71
|
-
return isPositive(summary.testCount);
|
|
23
|
+
return vestUtils.isPositive(summary.testCount);
|
|
72
24
|
}
|
|
73
|
-
if (hasOwnProperty(testedStorage, fieldName))
|
|
25
|
+
if (vestUtils.hasOwnProperty(testedStorage, fieldName))
|
|
74
26
|
return testedStorage[fieldName];
|
|
75
27
|
testedStorage[fieldName] =
|
|
76
|
-
hasOwnProperty(summary.tests, fieldName) &&
|
|
77
|
-
isPositive(summary.tests[fieldName].testCount);
|
|
28
|
+
vestUtils.hasOwnProperty(summary.tests, fieldName) &&
|
|
29
|
+
vestUtils.isPositive(summary.tests[fieldName].testCount);
|
|
78
30
|
return selectors.tested(fieldName);
|
|
79
31
|
}
|
|
80
32
|
function isUntested(fieldName) {
|
|
81
|
-
return !(isPositive(summary.testCount) && selectors.tested(fieldName));
|
|
33
|
+
return !(vestUtils.isPositive(summary.testCount) && selectors.tested(fieldName));
|
|
82
34
|
}
|
|
83
35
|
}
|
|
84
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vest")):"function"==typeof define&&define.amd?define(["exports","vest"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).parser={},e.vest)}(this,(function(e,t
|
|
1
|
+
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vest"),require("vest-utils")):"function"==typeof define&&define.amd?define(["exports","vest","vest-utils"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).parser={},e.vest,e["vest-utils"])}(this,(function(e,t,s){e.parse=function(e){s.invariant(e&&s.hasOwnProperty(e,"valid"),"Vest parser: expected argument at position 0 to be Vest's result object.");var i=t.suiteSelectors(e),n={},r={invalid:i.hasErrors,tested:function(t){return t?s.hasOwnProperty(n,t)?n[t]:(n[t]=s.hasOwnProperty(e.tests,t)&&s.isPositive(e.tests[t].testCount),r.tested(t)):s.isPositive(e.testCount)},untested:function(t){return!(s.isPositive(e.testCount)&&r.tested(t))},valid:i.isValid,warning:i.hasWarnings};return r},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -1,34 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.promisify = factory());
|
|
5
|
-
}(this, (function () { 'use strict';
|
|
6
|
-
|
|
7
|
-
function isFunction(value) {
|
|
8
|
-
return typeof value === 'function';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function optionalFunctionValue(value) {
|
|
12
|
-
var args = [];
|
|
13
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
14
|
-
args[_i - 1] = arguments[_i];
|
|
15
|
-
}
|
|
16
|
-
return isFunction(value) ? value.apply(void 0, args) : value;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function invariant(condition,
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
21
|
-
message) {
|
|
22
|
-
if (condition) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
// If message is a string object (rather than string literal)
|
|
26
|
-
// Throw the value directly as a string
|
|
27
|
-
// Alternatively, throw an error with the message
|
|
28
|
-
throw message instanceof String
|
|
29
|
-
? message.valueOf()
|
|
30
|
-
: new Error(message ? optionalFunctionValue(message) : message);
|
|
31
|
-
}
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('vest-utils')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['vest-utils'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.promisify = factory(global['vest-utils']));
|
|
5
|
+
}(this, (function (vestUtils) { 'use strict';
|
|
32
6
|
|
|
33
7
|
var promisify = function (validatorFn) {
|
|
34
8
|
return function () {
|
|
@@ -36,7 +10,7 @@
|
|
|
36
10
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
37
11
|
args[_i] = arguments[_i];
|
|
38
12
|
}
|
|
39
|
-
invariant(isFunction(validatorFn), 'promisify: Expected validatorFn to be a function.');
|
|
13
|
+
vestUtils.invariant(vestUtils.isFunction(validatorFn), 'promisify: Expected validatorFn to be a function.');
|
|
40
14
|
return new Promise(function (resolve) { return validatorFn.apply(void 0, args).done(resolve); });
|
|
41
15
|
};
|
|
42
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(n
|
|
1
|
+
"use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("vest-utils")):"function"==typeof define&&define.amd?define(["vest-utils"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).promisify=n(e["vest-utils"])}(this,(function(e){return function(n){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.invariant(e.isFunction(n),"promisify: Expected validatorFn to be a function."),new Promise((function(e){return n.apply(void 0,t).done(e)}))}}}));
|