vest 4.4.3-dev-c786f7 → 4.6.0
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/classnames.development.js +13 -36
- package/dist/cjs/classnames.production.js +1 -1
- package/dist/cjs/parser.development.js +13 -36
- package/dist/cjs/parser.production.js +1 -1
- package/dist/cjs/vest.development.js +232 -187
- package/dist/cjs/vest.production.js +1 -1
- package/dist/es/classnames.development.js +14 -37
- package/dist/es/classnames.production.js +1 -1
- package/dist/es/parser.development.js +14 -37
- package/dist/es/parser.production.js +1 -1
- package/dist/es/vest.development.js +233 -189
- package/dist/es/vest.production.js +1 -1
- package/dist/umd/classnames.development.js +19 -96
- package/dist/umd/classnames.production.js +1 -1
- package/dist/umd/enforce/compose.development.js +9 -665
- package/dist/umd/enforce/compose.production.js +1 -1
- package/dist/umd/enforce/compounds.development.js +17 -667
- package/dist/umd/enforce/compounds.production.js +1 -1
- package/dist/umd/enforce/schema.development.js +12 -668
- package/dist/umd/enforce/schema.production.js +1 -1
- package/dist/umd/parser.development.js +18 -95
- 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 +336 -1067
- package/dist/umd/vest.production.js +1 -1
- package/package.json +4 -4
- package/types/enforce/compose.d.ts +2 -1
- package/types/enforce/compounds.d.ts +8 -9
- package/types/enforce/schema.d.ts +7 -5
- package/types/parser.d.ts +8 -7
- package/types/promisify.d.ts +20 -35
- package/types/vest.d.ts +79 -81
|
@@ -1,58 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vestUtils = require('vest-utils');
|
|
4
|
+
var vest = require('vest');
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(Severity || (Severity = {}));
|
|
10
|
-
var SeverityCount;
|
|
11
|
-
(function (SeverityCount) {
|
|
12
|
-
SeverityCount["ERROR_COUNT"] = "errorCount";
|
|
13
|
-
SeverityCount["WARN_COUNT"] = "warnCount";
|
|
14
|
-
})(SeverityCount || (SeverityCount = {}));
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line max-lines-per-function
|
|
17
|
-
function parse(res) {
|
|
18
|
-
vestUtils.invariant(res && vestUtils.hasOwnProperty(res, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
|
|
6
|
+
// eslint-disable-next-line max-statements
|
|
7
|
+
function parse(summary) {
|
|
8
|
+
vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
|
|
9
|
+
var sel = vest.suiteSelectors(summary);
|
|
19
10
|
var testedStorage = {};
|
|
20
11
|
var selectors = {
|
|
21
|
-
invalid: hasErrors,
|
|
12
|
+
invalid: sel.hasErrors,
|
|
22
13
|
tested: isTested,
|
|
23
14
|
untested: isUntested,
|
|
24
|
-
valid: isValid,
|
|
25
|
-
warning: hasWarnings
|
|
15
|
+
valid: sel.isValid,
|
|
16
|
+
warning: sel.hasWarnings
|
|
26
17
|
};
|
|
27
18
|
return selectors;
|
|
19
|
+
// Booleans
|
|
28
20
|
function isTested(fieldName) {
|
|
29
21
|
if (!fieldName) {
|
|
30
|
-
return vestUtils.isPositive(
|
|
22
|
+
return vestUtils.isPositive(summary.testCount);
|
|
31
23
|
}
|
|
32
24
|
if (vestUtils.hasOwnProperty(testedStorage, fieldName))
|
|
33
25
|
return testedStorage[fieldName];
|
|
34
26
|
testedStorage[fieldName] =
|
|
35
|
-
vestUtils.hasOwnProperty(
|
|
36
|
-
vestUtils.isPositive(
|
|
27
|
+
vestUtils.hasOwnProperty(summary.tests, fieldName) &&
|
|
28
|
+
vestUtils.isPositive(summary.tests[fieldName].testCount);
|
|
37
29
|
return selectors.tested(fieldName);
|
|
38
30
|
}
|
|
39
31
|
function isUntested(fieldName) {
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
function isValid(fieldName) {
|
|
43
|
-
var _a;
|
|
44
|
-
return fieldName ? Boolean((_a = res.tests[fieldName]) === null || _a === void 0 ? void 0 : _a.valid) : res.valid;
|
|
45
|
-
}
|
|
46
|
-
function hasWarnings(fieldName) {
|
|
47
|
-
return hasFailures(SeverityCount.WARN_COUNT, fieldName);
|
|
48
|
-
}
|
|
49
|
-
function hasErrors(fieldName) {
|
|
50
|
-
return hasFailures(SeverityCount.ERROR_COUNT, fieldName);
|
|
51
|
-
}
|
|
52
|
-
function hasFailures(countKey, fieldName) {
|
|
53
|
-
var _a;
|
|
54
|
-
var failureCount = vestUtils.defaultTo(fieldName ? (_a = res.tests[fieldName]) === null || _a === void 0 ? void 0 : _a[countKey] : res[countKey], 0);
|
|
55
|
-
return vestUtils.isPositive(failureCount);
|
|
32
|
+
return !(vestUtils.isPositive(summary.testCount) && selectors.tested(fieldName));
|
|
56
33
|
}
|
|
57
34
|
}
|
|
58
35
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t
|
|
1
|
+
"use strict";var t=require("vest-utils"),e=require("vest");module.exports=function(s,r){void 0===r&&(r={});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 r=e.suiteSelectors(s),i={},n={invalid:r.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),n.tested(e)):t.isPositive(s.testCount)},untested:function(e){return!(t.isPositive(s.testCount)&&n.tested(e))},valid:r.isValid,warning:r.hasWarnings};return n}(s);return function(e){var s,n=[];for(s in r){var o=s;t.isFunction(i[o])&&i[o](e)&&n.push(r[o])}return n.join(" ")}};
|
|
@@ -2,59 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vest = require('vest');
|
|
5
6
|
var vestUtils = require('vest-utils');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(Severity || (Severity = {}));
|
|
12
|
-
var SeverityCount;
|
|
13
|
-
(function (SeverityCount) {
|
|
14
|
-
SeverityCount["ERROR_COUNT"] = "errorCount";
|
|
15
|
-
SeverityCount["WARN_COUNT"] = "warnCount";
|
|
16
|
-
})(SeverityCount || (SeverityCount = {}));
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line max-lines-per-function
|
|
19
|
-
function parse(res) {
|
|
20
|
-
vestUtils.invariant(res && vestUtils.hasOwnProperty(res, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
|
|
8
|
+
// eslint-disable-next-line max-statements
|
|
9
|
+
function parse(summary) {
|
|
10
|
+
vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
|
|
11
|
+
var sel = vest.suiteSelectors(summary);
|
|
21
12
|
var testedStorage = {};
|
|
22
13
|
var selectors = {
|
|
23
|
-
invalid: hasErrors,
|
|
14
|
+
invalid: sel.hasErrors,
|
|
24
15
|
tested: isTested,
|
|
25
16
|
untested: isUntested,
|
|
26
|
-
valid: isValid,
|
|
27
|
-
warning: hasWarnings
|
|
17
|
+
valid: sel.isValid,
|
|
18
|
+
warning: sel.hasWarnings
|
|
28
19
|
};
|
|
29
20
|
return selectors;
|
|
21
|
+
// Booleans
|
|
30
22
|
function isTested(fieldName) {
|
|
31
23
|
if (!fieldName) {
|
|
32
|
-
return vestUtils.isPositive(
|
|
24
|
+
return vestUtils.isPositive(summary.testCount);
|
|
33
25
|
}
|
|
34
26
|
if (vestUtils.hasOwnProperty(testedStorage, fieldName))
|
|
35
27
|
return testedStorage[fieldName];
|
|
36
28
|
testedStorage[fieldName] =
|
|
37
|
-
vestUtils.hasOwnProperty(
|
|
38
|
-
vestUtils.isPositive(
|
|
29
|
+
vestUtils.hasOwnProperty(summary.tests, fieldName) &&
|
|
30
|
+
vestUtils.isPositive(summary.tests[fieldName].testCount);
|
|
39
31
|
return selectors.tested(fieldName);
|
|
40
32
|
}
|
|
41
33
|
function isUntested(fieldName) {
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
function isValid(fieldName) {
|
|
45
|
-
var _a;
|
|
46
|
-
return fieldName ? Boolean((_a = res.tests[fieldName]) === null || _a === void 0 ? void 0 : _a.valid) : res.valid;
|
|
47
|
-
}
|
|
48
|
-
function hasWarnings(fieldName) {
|
|
49
|
-
return hasFailures(SeverityCount.WARN_COUNT, fieldName);
|
|
50
|
-
}
|
|
51
|
-
function hasErrors(fieldName) {
|
|
52
|
-
return hasFailures(SeverityCount.ERROR_COUNT, fieldName);
|
|
53
|
-
}
|
|
54
|
-
function hasFailures(countKey, fieldName) {
|
|
55
|
-
var _a;
|
|
56
|
-
var failureCount = vestUtils.defaultTo(fieldName ? (_a = res.tests[fieldName]) === null || _a === void 0 ? void 0 : _a[countKey] : res[countKey], 0);
|
|
57
|
-
return vestUtils.isPositive(failureCount);
|
|
34
|
+
return !(vestUtils.isPositive(summary.testCount) && selectors.tested(fieldName));
|
|
58
35
|
}
|
|
59
36
|
}
|
|
60
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("vest"),e=require("vest-utils");exports.parse=function(s){e.invariant(s&&e.hasOwnProperty(s,"valid"),"Vest parser: expected argument at position 0 to be Vest's result object.");var r=t.suiteSelectors(s),i={},n={invalid:r.hasErrors,tested:function(t){return t?e.hasOwnProperty(i,t)?i[t]:(i[t]=e.hasOwnProperty(s.tests,t)&&e.isPositive(s.tests[t].testCount),n.tested(t)):e.isPositive(s.testCount)},untested:function(t){return!(e.isPositive(s.testCount)&&n.tested(t))},valid:r.isValid,warning:r.hasWarnings};return n};
|