vest 4.6.1 → 4.6.2-dev-b9b126
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.production.js +1 -1
- package/dist/cjs/enforce/compose.development.js +5 -54
- package/dist/cjs/enforce/compose.production.js +1 -1
- package/dist/cjs/enforce/compounds.development.js +1 -89
- package/dist/cjs/enforce/compounds.production.js +1 -1
- package/dist/cjs/enforce/schema.development.js +1 -89
- package/dist/cjs/enforce/schema.production.js +1 -1
- package/dist/cjs/parser.development.js +1 -1
- package/dist/cjs/parser.production.js +1 -1
- package/dist/cjs/vest.development.js +5 -77
- package/dist/cjs/vest.production.js +1 -1
- package/dist/es/classnames.development.js +1 -1
- package/dist/es/classnames.production.js +1 -1
- package/dist/es/enforce/compose.development.js +1 -58
- package/dist/es/enforce/compose.production.js +1 -1
- package/dist/es/enforce/compounds.development.js +1 -90
- package/dist/es/enforce/compounds.production.js +1 -1
- package/dist/es/enforce/schema.development.js +1 -88
- package/dist/es/enforce/schema.production.js +1 -1
- package/dist/es/parser.development.js +1 -1
- package/dist/es/parser.production.js +1 -1
- package/dist/es/promisify.development.js +1 -1
- package/dist/es/promisify.production.js +1 -1
- package/dist/es/vest.development.js +4 -74
- package/dist/es/vest.production.js +1 -1
- package/dist/umd/classnames.development.js +3 -3
- package/dist/umd/classnames.production.js +1 -1
- package/dist/umd/enforce/compose.development.js +9 -57
- package/dist/umd/enforce/compose.production.js +1 -1
- package/dist/umd/enforce/compounds.development.js +5 -92
- package/dist/umd/enforce/compounds.production.js +1 -1
- package/dist/umd/enforce/schema.development.js +5 -92
- package/dist/umd/enforce/schema.production.js +1 -1
- package/dist/umd/parser.development.js +5 -5
- package/dist/umd/parser.production.js +1 -1
- package/dist/umd/promisify.development.js +3 -3
- package/dist/umd/promisify.production.js +1 -1
- package/dist/umd/vest.development.js +9 -82
- package/dist/umd/vest.production.js +1 -1
- package/package.json +3 -2
- 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 -126
- package/types/enforce/compose.d.ts.map +1 -0
- package/types/enforce/compounds.d.ts +1 -135
- package/types/enforce/compounds.d.ts.map +1 -0
- package/types/enforce/schema.d.ts +2 -144
- 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 +5 -10
- package/types/vest.d.ts.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"n4s/compounds";
|
|
@@ -1,88 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defaultTo, mapFirst, isNullish, hasOwnProperty } from 'vest-utils';
|
|
3
|
-
|
|
4
|
-
function ruleReturn(pass, message) {
|
|
5
|
-
var output = { pass: pass };
|
|
6
|
-
if (message) {
|
|
7
|
-
output.message = message;
|
|
8
|
-
}
|
|
9
|
-
return output;
|
|
10
|
-
}
|
|
11
|
-
function failing() {
|
|
12
|
-
return ruleReturn(false);
|
|
13
|
-
}
|
|
14
|
-
function passing() {
|
|
15
|
-
return ruleReturn(true);
|
|
16
|
-
}
|
|
17
|
-
function defaultToPassing(callback) {
|
|
18
|
-
return defaultTo(callback, passing());
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function runLazyRule(lazyRule, currentValue) {
|
|
22
|
-
try {
|
|
23
|
-
return lazyRule.run(currentValue);
|
|
24
|
-
}
|
|
25
|
-
catch (_a) {
|
|
26
|
-
return failing();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function isArrayOf(inputArray, currentRule) {
|
|
31
|
-
return defaultToPassing(mapFirst(inputArray, function (currentValue, breakout, index) {
|
|
32
|
-
var res = ctx.run({ value: currentValue, set: true, meta: { index: index } }, function () { return runLazyRule(currentRule, currentValue); });
|
|
33
|
-
breakout(!res.pass, res);
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function loose(inputObject, shapeObject) {
|
|
38
|
-
var _loop_1 = function (key) {
|
|
39
|
-
var currentValue = inputObject[key];
|
|
40
|
-
var currentRule = shapeObject[key];
|
|
41
|
-
var res = ctx.run({ value: currentValue, set: true, meta: { key: key } }, function () {
|
|
42
|
-
return runLazyRule(currentRule, currentValue);
|
|
43
|
-
});
|
|
44
|
-
if (!res.pass) {
|
|
45
|
-
return { value: res };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
for (var key in shapeObject) {
|
|
49
|
-
var state_1 = _loop_1(key);
|
|
50
|
-
if (typeof state_1 === "object")
|
|
51
|
-
return state_1.value;
|
|
52
|
-
}
|
|
53
|
-
return passing();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function optional(value, ruleChain) {
|
|
57
|
-
if (isNullish(value)) {
|
|
58
|
-
return passing();
|
|
59
|
-
}
|
|
60
|
-
return runLazyRule(ruleChain, value);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function shape(inputObject, shapeObject) {
|
|
64
|
-
var baseRes = loose(inputObject, shapeObject);
|
|
65
|
-
if (!baseRes.pass) {
|
|
66
|
-
return baseRes;
|
|
67
|
-
}
|
|
68
|
-
for (var key in inputObject) {
|
|
69
|
-
if (!hasOwnProperty(shapeObject, key)) {
|
|
70
|
-
return failing();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return passing();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Help needed improving the typings of this file.
|
|
77
|
-
// Ideally, we'd be able to extend ShapeObject, but that's not possible.
|
|
78
|
-
function partial(shapeObject) {
|
|
79
|
-
var output = {};
|
|
80
|
-
for (var key in shapeObject) {
|
|
81
|
-
output[key] = enforce.optional(shapeObject[key]);
|
|
82
|
-
}
|
|
83
|
-
return output;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
enforce.extend({ isArrayOf: isArrayOf, loose: loose, optional: optional, shape: shape });
|
|
87
|
-
|
|
88
|
-
export { partial };
|
|
1
|
+
import 'n4s/schema';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"n4s/schema";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{invariant as t,hasOwnProperty as e,isPositive as s}from"vest-utils";import{suiteSelectors as r}from"vest";
|
|
1
|
+
import{invariant as t,hasOwnProperty as e,isPositive as s}from"vest-utils";import{suiteSelectors as r}from"vest";function n(n){t(n&&e(n,"valid"),"Vest parser: expected argument at position 0 to be Vest's result object.");var i=r(n),o={},u={invalid:i.hasErrors,tested:function(t){if(!t)return s(n.testCount);return e(o,t)?o[t]:(o[t]=e(n.tests,t)&&s(n.tests[t].testCount),u.tested(t))},untested:function(t){return!(s(n.testCount)&&u.tested(t))},valid:i.isValid,warning:i.hasWarnings};return u}export{n as parse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{invariant as t,isFunction as n}from"vest-utils";
|
|
1
|
+
import{invariant as t,isFunction as n}from"vest-utils";var r=function(r){return function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];return t(n(r),"promisify: Expected validatorFn to be a function."),new Promise((function(t){return r.apply(void 0,o).done(t)}))}};export{r as default};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { enforce } from 'n4s';
|
|
2
|
-
import { isUndefined, isStringValue, assign, cache as cache$2,
|
|
2
|
+
import { isUndefined, isStringValue, assign, cache as cache$2, asArray, nestedArray, seq, isNullish, deferThrow, invariant, isFunction, bindNot, either, isArray, optionalFunctionValue, isEmpty, isNotEmpty, isPositive, numberEquals, hasOwnProperty, callEach, bus, defaultTo, isPromise, isNull } from 'vest-utils';
|
|
3
3
|
import { createCascade } from 'context';
|
|
4
|
+
import { createState } from 'vast';
|
|
4
5
|
|
|
5
6
|
function shouldUseErrorAsMessage(message, error) {
|
|
6
7
|
// kind of cheating with this safe guard, but it does the job
|
|
@@ -285,70 +286,6 @@ var STATUS_PENDING = 'PENDING';
|
|
|
285
286
|
var STATUS_CANCELED = 'CANCELED';
|
|
286
287
|
var STATUS_OMITTED = 'OMITTED';
|
|
287
288
|
|
|
288
|
-
// eslint-disable-next-line max-lines-per-function
|
|
289
|
-
function createState(onStateChange) {
|
|
290
|
-
var state = {
|
|
291
|
-
references: []
|
|
292
|
-
};
|
|
293
|
-
var registrations = [];
|
|
294
|
-
return {
|
|
295
|
-
registerStateKey: registerStateKey,
|
|
296
|
-
reset: reset
|
|
297
|
-
};
|
|
298
|
-
/**
|
|
299
|
-
* Registers a new key in the state, takes the initial value (may be a function that returns the initial value), returns a function.
|
|
300
|
-
*
|
|
301
|
-
* @example
|
|
302
|
-
*
|
|
303
|
-
* const useColor = state.registerStateKey("blue");
|
|
304
|
-
*
|
|
305
|
-
* let [color, setColor] = useColor(); // -> ["blue", Function]
|
|
306
|
-
*
|
|
307
|
-
* setColor("green");
|
|
308
|
-
*
|
|
309
|
-
* useColor()[0]; -> "green"
|
|
310
|
-
*/
|
|
311
|
-
function registerStateKey(initialState, onUpdate) {
|
|
312
|
-
var key = registrations.length;
|
|
313
|
-
registrations.push([initialState, onUpdate]);
|
|
314
|
-
return initKey(key, initialState);
|
|
315
|
-
}
|
|
316
|
-
function reset() {
|
|
317
|
-
var prev = current();
|
|
318
|
-
state.references = [];
|
|
319
|
-
registrations.forEach(function (_a, index) {
|
|
320
|
-
var initialValue = _a[0];
|
|
321
|
-
return initKey(index, initialValue, prev[index]);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
function initKey(key, initialState, prevState) {
|
|
325
|
-
current().push();
|
|
326
|
-
set(key, optionalFunctionValue(initialState, prevState));
|
|
327
|
-
return function useStateKey() {
|
|
328
|
-
return [
|
|
329
|
-
current()[key],
|
|
330
|
-
function (nextState) {
|
|
331
|
-
return set(key, optionalFunctionValue(nextState, current()[key]));
|
|
332
|
-
},
|
|
333
|
-
];
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
function current() {
|
|
337
|
-
return state.references;
|
|
338
|
-
}
|
|
339
|
-
function set(index, value) {
|
|
340
|
-
var prevValue = state.references[index];
|
|
341
|
-
state.references[index] = value;
|
|
342
|
-
var _a = registrations[index], onUpdate = _a[1];
|
|
343
|
-
if (isFunction(onUpdate)) {
|
|
344
|
-
onUpdate(value, prevValue);
|
|
345
|
-
}
|
|
346
|
-
if (isFunction(onStateChange)) {
|
|
347
|
-
onStateChange();
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
289
|
function createStateRef(state, _a) {
|
|
353
290
|
var suiteId = _a.suiteId, suiteName = _a.suiteName;
|
|
354
291
|
return {
|
|
@@ -1503,14 +1440,7 @@ function runAsyncTest(testObject) {
|
|
|
1503
1440
|
testObject.fail();
|
|
1504
1441
|
done();
|
|
1505
1442
|
});
|
|
1506
|
-
|
|
1507
|
-
asyncTest.then(done, fail);
|
|
1508
|
-
}
|
|
1509
|
-
catch (e) {
|
|
1510
|
-
// We will probably never get here, unless the consumer uses a buggy custom Promise
|
|
1511
|
-
// implementation that behaves differently than the native one, or if they for some
|
|
1512
|
-
fail();
|
|
1513
|
-
}
|
|
1443
|
+
asyncTest.then(done, fail);
|
|
1514
1444
|
}
|
|
1515
1445
|
|
|
1516
1446
|
/**
|
|
@@ -1729,6 +1659,6 @@ function warn() {
|
|
|
1729
1659
|
ctx.currentTest.warn();
|
|
1730
1660
|
}
|
|
1731
1661
|
|
|
1732
|
-
var VERSION = "4.6.
|
|
1662
|
+
var VERSION = "4.6.2-dev-b9b126";
|
|
1733
1663
|
|
|
1734
1664
|
export { VERSION, context, create, each, eager, group, include, omitWhen, only, optional, skip, skipWhen, suiteSelectors, test, warn };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCascade as t}from"context";import{isUndefined as n,isStringValue as e,assign as r,cache as i,nestedArray as u,asArray as s,seq as o,optionalFunctionValue as a,isFunction as c,isNullish as f,deferThrow as l,invariant as d,bindNot as p,either as v,isArray as E,isEmpty as N,isNotEmpty as h,isPositive as m,numberEquals as g,hasOwnProperty as y,callEach as R,bus as S,defaultTo as C,isPromise as T,isNull as _}from"vest-utils";export{enforce}from"n4s";var O,I=O||(O={});I[I.DEFAULT=0]="DEFAULT",I[I.SUITE=1]="SUITE",I[I.EACH=2]="EACH",I[I.SKIP_WHEN=3]="SKIP_WHEN",I[I.OMIT_WHEN=4]="OMIT_WHEN",I[I.GROUP=5]="GROUP";var A,k=A||(A={});function b(){var t=0;return{current:function(){return t},next:function(){t++}}}function U(t,n){return void 0===n&&(n=[]),{cursor:b(),keys:{current:{},prev:{}},path:n,type:t}}k[k.ALL=0]="ALL",k[k.EAGER=1]="EAGER";var L=t((function(t,n){return n?null:r({exclusion:{tests:{},groups:{}},inclusion:{},isolate:U(O.DEFAULT),mode:[A.ALL]},t)}));function F(){return L.useX().stateRef}function D(t,n){(0,F().optionalFields()[1])((function(e){var i;return r(e,((i={})[t]=r({},e[t],n(e[t])),i))}))}function W(t){var n;return null!==(n=F().optionalFields()[0][t])&&void 0!==n?n:{}}function P(){G((function(t){return t}))}function G(t){(0,F().testObjects()[1])((function(n){return{prev:n.prev,current:s(t(n.current))}}))}function w(){return X().filter((function(t){return t.isPending()}))}var x=i();function X(){var t=F().testObjects()[0].current;return x([t],(function(){return u.flatten(t)}))}var H,K=H||(H={});K.Error="error",K.Warning="warning";var M=function(){function t(t,n,e){var r=void 0===e?{}:e;e=r.message;var i=r.groupName;r=r.key,this.key=null,this.id=o(),this.severity=H.Error,this.status=q,this.fieldName=t,this.testFn=n,i&&(this.groupName=i),e&&(this.message=e),r&&(this.key=r)}return t.prototype.run=function(){try{var t=this.testFn()}catch(r){t=r,n(this.message)&&e(t)&&(this.message=r),t=!1}return!1===t&&this.fail(),t},t.prototype.setStatus=function(t){this.isFinalStatus()&&t!==Q||(this.status=t)},t.prototype.warns=function(){return this.severity===H.Warning},t.prototype.setPending=function(){this.setStatus(J)},t.prototype.fail=function(){this.setStatus(this.warns()?j:V)},t.prototype.done=function(){this.isFinalStatus()||this.setStatus(Y)},t.prototype.warn=function(){this.severity=H.Warning},t.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},t.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(B)},t.prototype.cancel=function(){this.setStatus(z),P()},t.prototype.reset=function(){this.status=q,P()},t.prototype.omit=function(){this.setStatus(Q)},t.prototype.valueOf=function(){return!this.isFailing()},t.prototype.isPending=function(){return this.statusEquals(J)},t.prototype.isOmitted=function(){return this.statusEquals(Q)},t.prototype.isUntested=function(){return this.statusEquals(q)},t.prototype.isFailing=function(){return this.statusEquals(V)},t.prototype.isCanceled=function(){return this.statusEquals(z)},t.prototype.isSkipped=function(){return this.statusEquals(B)},t.prototype.isPassing=function(){return this.statusEquals(Y)},t.prototype.isWarning=function(){return this.statusEquals(j)},t.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},t.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},t.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},t.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},t.prototype.statusEquals=function(t){return this.status===t},t}(),q="UNTESTED",B="SKIPPED",V="FAILED",j="WARNING",Y="PASSING",J="PENDING",z="CANCELED",Q="OMITTED";function Z(t){function n(t,n,i){return r.references.push(),e(t,a(n,i)),function(){return[r.references[t],function(n){return e(t,a(n,r.references[t]))}]}}function e(n,e){var u=r.references[n];r.references[n]=e,n=i[n][1],c(n)&&n(e,u),c(t)&&t()}var r={references:[]},i=[];return{registerStateKey:function(t,e){var r=i.length;return i.push([t,e]),n(r,t)},reset:function(){var t=r.references;r.references=[],i.forEach((function(e,r){return n(r,e[0],t[r])}))}}}function $(t,n){var e=n.suiteId;return n=n.suiteName,{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(n),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function tt(){return L.useX().isolate}function nt(){var t=tt();return t.path.concat(t.cursor.current())}function et(t,n){t=void 0===(t=t.type)?O.DEFAULT:t,d(c(n));var e=U(t,nt());return t=L.run({isolate:e},(function(){return e.keys.prev=function(){var t=F().testObjects()[0].prev;return s(u.getCurrent(t,nt())).reduce((function(t,n){return n instanceof M&&!f(n.key)?(t[n.key]=n,t):t}),{})}(),G((function(t){return u.setValueAtPath(t,e.path,[])})),n()})),tt().cursor.next(),t}var rt,it=rt||(rt={});it.WARNINGS="warnings",it.ERRORS="errors";var ut,st=ut||(ut={});function ot(t,n){return!(!n||t.fieldName!==n)}st.ERROR_COUNT="errorCount",st.WARN_COUNT="warnCount";var at=p((function(t,n){return t.groupName===n}));function ct(t,n){return X().some((function(e){return ft(e,t,n)}))}function ft(t,n,e){return!(!t.hasFailures()||e&&!ot(t,e)||v(n===rt.WARNINGS,t.warns()))}function lt(t){return!!t&&W(t).applied}var dt,pt=dt||(dt={});function vt(t){if(lt(t))return!0;var n=X();return!(N(n)||ct(rt.ERRORS,t)||function(t){return h(w().filter((function(n){return Et(n,t)})))}(t))&&function(t){return X().every((function(n){return Nt(n,t)}))}(t)}function Et(t,n){return!(n&&!ot(t,n))&<(n)}function Nt(t,n){return!(!n||ot(t,n))||(W(t.fieldName).type===dt.Delayed&&t.awaitsResolution()||t.isTested()||t.isOmitted())}function ht(){var t=X(),n=r({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){var e=t.tests;e[n.fieldName]=mt(e,n),e[n.fieldName].valid=!1!==e[n.fieldName].valid&&vt(n.fieldName);var r=t.groups,i=n.groupName;return i&&(r[i]=r[i]||{},r[i][n.fieldName]=mt(r[i],n),e=r[i][n.fieldName],!1===r[i][n.fieldName].valid?n=!1:n=!!lt(n=n.fieldName)||!function(t,n,e){return X().some((function(r){return!at(r,n)&&ft(r,t,e)}))}(rt.ERRORS,i,n)&&!function(t,n){return h(w().filter((function(e){return!at(e,t)&&Et(e,n)})))}(i,n)&&function(t,n){return X().every((function(e){return!!at(e,t)||Nt(e,n)}))}(i,n),e.valid=n),t}),n),n.valid=vt(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function mt(t,n){function e(t){s[t===rt.ERRORS?ut.ERROR_COUNT:ut.WARN_COUNT]++,u&&(s[t]=(s[t]||[]).concat(u))}var i=n.fieldName,u=n.message;t[i]=t[i]||r({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var s=t[i];return n.isNonActionable()||(t[i].testCount++,n.isFailing()?e(rt.ERRORS):n.isWarning()&&e(rt.WARNINGS)),s}function gt(t,n,e){if(e){var r;t=(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r[n])||[]}else{for(var i in r={},e=n===rt.ERRORS?ut.ERROR_COUNT:ut.WARN_COUNT,t)m(t[i][e])&&(r[i]=t[i][n]||[]);t=r}return t}function yt(t){return{getErrors:function(n){return gt(t.tests,rt.ERRORS,n)},getErrorsByGroup:function(n,e){return gt(t.groups[n],rt.ERRORS,e)},getWarnings:function(n){return gt(t.tests,rt.WARNINGS,n)},getWarningsByGroup:function(n,e){return gt(t.groups[n],rt.WARNINGS,e)},hasErrors:function(n){return Ct(t,ut.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return St(t,ut.ERROR_COUNT,n,e)},hasWarnings:function(n){return Ct(t,ut.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return St(t,ut.WARN_COUNT,n,e)},isValid:function(n){var e;return n?!(null===(e=t.tests[n])||void 0===e||!e.valid):t.valid},isValidByGroup:function(n,e){if(!(n=t.groups[n]))return!1;if(e)return Rt(n,e);for(var r in n)if(!Rt(n,r))return!1;return!0}}}function Rt(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function St(t,n,e,r){var i,u;if(!(t=t.groups[e]))return!1;if(r)return m(null===(i=t[r])||void 0===i?void 0:i[n]);for(var s in t)if(m(null===(u=t[s])||void 0===u?void 0:u[n]))return!0;return!1}function Ct(t,n,e){var r;return t=e?null===(r=t.tests[e])||void 0===r?void 0:r[n]:t[n]||0,m(t)}pt[pt.Immediate=0]="Immediate",pt[pt.Delayed=1]="Delayed";var Tt=i(1);function _t(){var t=X(),n={stateRef:F()};return Tt([t],L.bind(n,(function(){var t=ht(),n=F().suiteName()[0];return r(t,yt(t),{suiteName:n})})))}function Ot(t){var n=w();return!N(n)&&(!t||n.some((function(n){return ot(n,t)})))}var It=i(20);function At(){var t=X(),n={stateRef:F()};return It([t],L.bind(n,(function(){return r({},_t(),{done:L.bind(n,Ut)})})))}function kt(t,n,e){var r;return!!(!c(t)||n&&g(null===(r=e.tests[n])||void 0===r?void 0:r.testCount,0))}function bt(t){return!(Ot()&&(!t||Ot(t)))}function Ut(){function t(){return r(_t())}for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=(n=n.reverse())[0];return n=n[1],e=At(),kt(r,n,e)?e:bt(n)?(t(),e):(Lt(t,n),e)}function Lt(t,n){(0,F().testCallbacks()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function Ft(){var t=S.createBus();return t.on(Wt.TEST_COMPLETED,(function(n){if(!n.isCanceled()){n.done(),n=n.fieldName;var e=F().testCallbacks()[0].fieldCallbacks;n&&!Ot(n)&&E(e[n])&&R(e[n]),Ot()||t.emit(Wt.ALL_RUNNING_TESTS_FINISHED)}})),t.on(Wt.SUITE_CALLBACK_DONE_RUNNING,(function(){!function(){function t(t){e[t.fieldName]&&(t.omit(),D(t.fieldName,(function(){return{applied:!0}})))}var n=F().optionalFields()[0];if(!N(n)){var e={};X().forEach((function(n){if(y(e,n.fieldName))t(n);else{var r=W(n.fieldName);r.type===dt.Immediate&&(e[n.fieldName]=a(r.rule),t(n))}})),P()}}()})),t.on(Wt.ALL_RUNNING_TESTS_FINISHED,(function(){var t=F().testCallbacks()[0].doneCallbacks;R(t)})),t.on(Wt.REMOVE_FIELD,(function(t){X().forEach((function(n){ot(n,t)&&(n.cancel(),function(t){G((function(n){return u.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(Wt.RESET_FIELD,(function(t){X().forEach((function(n){ot(n,t)&&n.reset()}))})),t}function Dt(){var t=L.useX();return d(t.bus),t.bus}var Wt,Pt=Wt||(Wt={});function Gt(t){return xt(0,"tests",t)}function wt(t){return xt(1,"tests",t)}function xt(t,n,r){var i=L.useX("hook called outside of a running suite.");r&&s(r).forEach((function(r){e(r)&&(i.exclusion[n][r]=0===t)}))}function Xt(t){for(var n in t)if(!0===t[n])return!0;return!1}function Ht(){var t,n=L.useX().exclusion;for(t in n.groups)if(n.groups[t])return!0;return!1}function Kt(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function Mt(t,n,e){if(e||2===arguments.length)for(var r,i=0,u=n.length;i<u;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}function qt(t){var n=t.asyncTest,r=t.message;if(T(n)){var i=Dt().emit,u=F(),s=L.bind({stateRef:u},(function(){P(),i(Wt.TEST_COMPLETED,t)}));u=L.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=e(n)?n:r,t.fail(),s())}));try{n.then(s,u)}catch(t){u()}}}function Bt(t){var n=F().testObjects()[0].prev;if(N(n))return Vt(t),t;var e=nt();if(n=u.valueAtPath(n,e),!f(t.key)){n=t.key,(e=tt().keys.prev[n])&&(t=e),e=t;var r=tt().keys.current;return f(r[n])?r[n]=e:l('Encountered the same test key "'.concat(n,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.")),Vt(t),t}return!h(e=n)||e.fieldName===t.fieldName&&e.groupName===t.groupName||(tt().type===O.EACH||l("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(n.fieldName,"\n received: ").concat(t.fieldName,'\n This can happen on one of two reasons:\n 1. You\'re using if/else statements to conditionally select tests. Instead, use "skipWhen".\n 2. You are iterating over a list of tests, and their order changed. Use "each" and a custom key prop so that Vest retains their state.')),function(){var t=tt().cursor.current();G((function(n){return n.splice(t),n}))}(),n=null),Vt(t=C(n,t)),t}function Vt(t){var n=nt();G((function(e){return u.setValueAtPath(e,n,t)}))}function jt(t){var n=tt().cursor,e=A.EAGER;if(L.useX().mode[0]===e&&ct(rt.ERRORS,t.fieldName))return t.skip(),Bt(t),n.next(),t;if(e=Bt(t),L.useX().omitted||lt(t.fieldName))return e.omit(),n.next(),e;if(function(t){var n=t.fieldName;if(t=t.groupName,L.useX().skipped)return!0;var e=L.useX(),r=e.exclusion;e=e.inclusion;var i=r.tests,u=i[n];if(!1===u)return!0;if(u=!0===u,t){var s=L.useX().exclusion.groups;if(s=y(s,t)?!1===s[t]:Ht())return!0;if(!0===r.groups[t])return!(u||!Xt(i)&&!1!==i[n])}return!!(t=!!Ht()&&!t)||!u&&!!Xt(i)&&!a(e[n])}(t))return e.skip(!!L.useX().skipped),n.next(),e;if(t!==e&&e.fieldName===t.fieldName&&e.groupName===t.groupName&&e.isPending()&&e.cancel(),Vt(t),t.isUntested()){e=Dt();var r=function(t){return L.run({currentTest:t},(function(){return t.run()}))}(t);try{T(r)?(t.asyncTest=r,t.setPending(),qt(t)):e.emit(Wt.TEST_COMPLETED,t)}catch(n){throw Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}else T(t.asyncTest)&&(t.setPending(),qt(t));return n.next(),t}function Yt(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=c(n[1])?n:Mt([void 0],n,!0);n=i[0],r=i[1],i=i[2],d(e(t),Zt("fieldName","string")),d(c(r),Zt("Test callback","function"));var u=L.useX();return jt(n=new M(t,r,{message:n,groupName:u.groupName,key:i}))}Pt.TEST_COMPLETED="test_completed",Pt.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",Pt.REMOVE_FIELD="remove_field",Pt.RESET_FIELD="reset_field",Pt.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running",Gt.group=function(t){return xt(0,"groups",t)},wt.group=function(t){return xt(1,"groups",t)};var Jt,zt,Qt=r(Yt,{memo:(Jt=Yt,zt=i(10),function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];e=tt().cursor.current();var r=(n=n.reverse())[0],i=n[1],u=n[2];return e=[F().suiteId()[0],t,e].concat(r),n=zt.get(e),_(n)?zt(e,(function(){return Jt(t,u,i)})):n[1].isCanceled()?(zt.invalidate(e),zt(e,(function(){return Jt(t,u,i)}))):jt(n[1])})});function Zt(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}var $t="4.6.1";function tn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=(t=t.reverse())[0];t=t[1],d(c(e),"vest.create: Expected callback to be a function.");var i=Ft(),u=Z();return t={stateRef:$(u,{suiteId:o(),suiteName:t}),bus:i},r(L.bind(t,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return u.reset(),et({type:O.SUITE},(function(){e.apply(void 0,t)})),i.emit(Wt.SUITE_CALLBACK_DONE_RUNNING),At()})),{get:L.bind(t,_t),remove:L.bind(t,(function(t){i.emit(Wt.REMOVE_FIELD,t)})),reset:u.reset,resetField:L.bind(t,(function(t){i.emit(Wt.RESET_FIELD,t)}))})}function nn(t,n){d(c(n),"each callback must be a function"),et({type:O.EACH},(function(){t.forEach((function(t,e){n(t,e)}))}))}function en(){var t=A.EAGER;L.useX().mode[0]=t}function rn(t,n){d(e(t),Kt("name must be a string")),d(c(n),Kt("callback must be a function")),et({type:O.GROUP},(function(){L.run({groupName:t},n)}))}function un(t){var n=L.useX(),r=n.inclusion;return n=n.exclusion,d(e(t)),r[t]=C(n.tests[t],!0),{when:function(n){var r=L.useX(),i=r.exclusion;r.inclusion[t]=function(){return y(i.tests,t)?C(i.tests[t],!0):e(n)?!!i.tests[n]:a(n,a(_t))}}}}function sn(t,n){et({type:O.OMIT_WHEN},(function(){L.run({omitted:!!L.useX().omitted||a(t,a(_t))},(function(){return n()}))}))}function on(t){if(E(t)||e(t))s(t).forEach((function(t){D(t,(function(){return{type:dt.Delayed,applied:!1,rule:null}}))}));else{var n,r=function(n){var e=t[n];D(n,(function(){return{type:dt.Immediate,rule:e,applied:a(e)}}))};for(n in t)r(n)}}function an(t,n){et({type:O.SKIP_WHEN},(function(){L.run({skipped:!!L.useX().skipped||a(t,a(_t))},(function(){return n()}))}))}function cn(){var t=L.useX("warn hook called outside of a running suite.");d(t.currentTest,"warn called outside of a test."),t.currentTest.warn()}export{$t as VERSION,L as context,tn as create,nn as each,en as eager,rn as group,un as include,sn as omitWhen,Gt as only,on as optional,wt as skip,an as skipWhen,yt as suiteSelectors,Qt as test,cn as warn};
|
|
1
|
+
export{enforce}from"n4s";import{isUndefined as t,isStringValue as n,assign as e,cache as r,asArray as u,nestedArray as i,seq as o,isNullish as s,deferThrow as a,invariant as c,isFunction as f,bindNot as l,either as d,isArray as p,optionalFunctionValue as v,isEmpty as E,isNotEmpty as m,isPositive as N,numberEquals as h,hasOwnProperty as g,callEach as y,bus as R,defaultTo as S,isPromise as T,isNull as C}from"vest-utils";import{createCascade as I}from"context";import{createState as _}from"vast";var A,O;function b(t,n){return void 0===n&&(n=[]),{cursor:(e={value:0},{current:function(){return e.value},next:function(){e.value++}}),keys:{current:{},prev:{}},path:n,type:t};var e}!function(t){t[t.DEFAULT=0]="DEFAULT",t[t.SUITE=1]="SUITE",t[t.EACH=2]="EACH",t[t.SKIP_WHEN=3]="SKIP_WHEN",t[t.OMIT_WHEN=4]="OMIT_WHEN",t[t.GROUP=5]="GROUP"}(A||(A={})),function(t){t[t.ALL=0]="ALL",t[t.EAGER=1]="EAGER"}(O||(O={}));var k=I((function(t,n){return n?null:e({exclusion:{tests:{},groups:{}},inclusion:{},isolate:b(A.DEFAULT),mode:[O.ALL]},t)}));function L(){return k.useX().stateRef}function U(){return L().suiteId()[0]}function D(){return L().testCallbacks()}function F(){return L().optionalFields()}function P(t,n){(0,F()[1])((function(r){var u;return e(r,((u={})[t]=e({},r[t],n(r[t])),u))}))}function W(t){var n;return null!==(n=F()[0][t])&&void 0!==n?n:{}}function G(){return L().testObjects()}function w(){x((function(t){return t}))}function x(t){(0,G()[1])((function(n){var e=n.current;return{prev:n.prev,current:u(t(e))}}))}function X(){return B().filter((function(t){return t.isPending()}))}var H,K=r();function B(){var t=G()[0].current;return K([t],(function(){return i.flatten(t)}))}function M(t){B().forEach(t)}!function(t){t.Error="error",t.Warning="warning"}(H||(H={}));var q,V,j=function(){function e(t,n,e){var r=void 0===e?{}:e,u=r.message,i=r.groupName,s=r.key;this.key=null,this.id=o(),this.severity=H.Error,this.status=Y,this.fieldName=t,this.testFn=n,i&&(this.groupName=i),u&&(this.message=u),s&&(this.key=s)}return e.prototype.run=function(){var e;try{e=this.testFn()}catch(r){(function(e,r){return t(e)&&n(r)})(this.message,r)&&(this.message=r),e=!1}return!1===e&&this.fail(),e},e.prototype.setStatus=function(t){this.isFinalStatus()&&t!==nt||(this.status=t)},e.prototype.warns=function(){return this.severity===H.Warning},e.prototype.setPending=function(){this.setStatus($)},e.prototype.fail=function(){this.setStatus(this.warns()?Q:z)},e.prototype.done=function(){this.isFinalStatus()||this.setStatus(Z)},e.prototype.warn=function(){this.severity=H.Warning},e.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},e.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(J)},e.prototype.cancel=function(){this.setStatus(tt),w()},e.prototype.reset=function(){this.status=Y,w()},e.prototype.omit=function(){this.setStatus(nt)},e.prototype.valueOf=function(){return!this.isFailing()},e.prototype.isPending=function(){return this.statusEquals($)},e.prototype.isOmitted=function(){return this.statusEquals(nt)},e.prototype.isUntested=function(){return this.statusEquals(Y)},e.prototype.isFailing=function(){return this.statusEquals(z)},e.prototype.isCanceled=function(){return this.statusEquals(tt)},e.prototype.isSkipped=function(){return this.statusEquals(J)},e.prototype.isPassing=function(){return this.statusEquals(Z)},e.prototype.isWarning=function(){return this.statusEquals(Q)},e.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},e.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},e.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},e.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},e.prototype.statusEquals=function(t){return this.status===t},e}(),Y="UNTESTED",J="SKIPPED",z="FAILED",Q="WARNING",Z="PASSING",$="PENDING",tt="CANCELED",nt="OMITTED";function et(t,n){var e=n.suiteId,r=n.suiteName;return{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(r),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function rt(){return k.useX().isolate}function ut(){var t=rt();return t.path.concat(t.cursor.current())}function it(){return rt().cursor}function ot(t,n){var e=t.type,r=void 0===e?A.DEFAULT:e;c(f(n));var o=b(r,ut()),a=k.run({isolate:o},(function(){var t;return o.keys.prev=(t=G()[0].prev,u(i.getCurrent(t,ut())).reduce((function(t,n){return n instanceof j?(s(n.key)||(t[n.key]=n),t):t}),{})),x((function(t){return i.setValueAtPath(t,o.path,[])})),n()}));return it().next(),a}function st(t){return t===q.ERRORS?V.ERROR_COUNT:V.WARN_COUNT}function at(t,n){return!!n&&!ct(t,n)}function ct(t,n){return!(!n||t.fieldName!==n)}!function(t){t.WARNINGS="warnings",t.ERRORS="errors"}(q||(q={})),function(t){t.ERROR_COUNT="errorCount",t.WARN_COUNT="warnCount"}(V||(V={}));var ft,lt=l((function(t,n){return t.groupName===n}));function dt(t){return function(t,n){return B().some((function(e){return pt(e,t,n)}))}(q.ERRORS,t)}function pt(t,n,e){return!!t.hasFailures()&&(!at(t,e)&&!function(t,n){return d(t===q.WARNINGS,n.warns())}(n,t))}function vt(t){if(p(t)||n(t))u(t).forEach((function(t){P(t,(function(){return{type:ft.Delayed,applied:!1,rule:null}}))}));else{var e=function(n){var e=t[n];P(n,(function(){return{type:ft.Immediate,rule:e,applied:v(e)}}))};for(var r in t)e(r)}}function Et(t){return!!t&&W(t).applied}function mt(t){if(Et(t))return!0;var n=B();return!E(n)&&(!dt(t)&&(!function(t){return m(X().filter((function(n){return ht(n,t)})))}(t)&&function(t){return B().every((function(n){return gt(n,t)}))}(t)))}function Nt(t,n){return!!Et(n)||!function(t,n,e){return B().some((function(r){return!lt(r,n)&&pt(r,t,e)}))}(q.ERRORS,t,n)&&(!function(t,n){return m(X().filter((function(e){return!lt(e,t)&&ht(e,n)})))}(t,n)&&function(t,n){return B().every((function(e){return!!lt(e,t)||gt(e,n)}))}(t,n))}function ht(t,n){return!at(t,n)&&Et(n)}function gt(t,n){return!!at(t,n)||(function(t){return W(t.fieldName).type===ft.Delayed&&t.awaitsResolution()}(t)||t.isTested()||t.isOmitted())}function yt(){var t=B(),n=e({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){return function(t,n){t[n.fieldName]=Rt(t,n),t[n.fieldName].valid=!1!==t[n.fieldName].valid&&mt(n.fieldName)}(t.tests,n),function(t,n){var e=n.groupName;if(!e)return;t[e]=t[e]||{},t[e][n.fieldName]=Rt(t[e],n),t[e][n.fieldName].valid=!1!==t[e][n.fieldName].valid&&Nt(e,n.fieldName)}(t.groups,n),t}),n),n.valid=mt(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function Rt(t,n){var r=n.fieldName,u=n.message;t[r]=t[r]||e({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var i=t[r];return n.isNonActionable()||(t[r].testCount++,n.isFailing()?o(q.ERRORS):n.isWarning()&&o(q.WARNINGS)),i;function o(t){var n=st(t);i[n]++,u&&(i[t]=(i[t]||[]).concat(u))}}function St(t,n,e){return e?function(t,n,e){var r;return(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r[n])||[]}(t,n,e):function(t,n){var e={},r=st(n);for(var u in t)N(t[u][r])&&(e[u]=t[u][n]||[]);return e}(t,n)}function Tt(t){var n={getErrors:function(n){return Ct(t,q.ERRORS,n)},getErrorsByGroup:function(n,e){return It(t,q.ERRORS,n,e)},getWarnings:function(n){return Ct(t,q.WARNINGS,n)},getWarningsByGroup:function(n,e){return It(t,q.WARNINGS,n,e)},hasErrors:function(n){return Ot(t,V.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return At(t,V.ERROR_COUNT,n,e)},hasWarnings:function(n){return Ot(t,V.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return At(t,V.WARN_COUNT,n,e)},isValid:function(n){var e;return n?Boolean(null===(e=t.tests[n])||void 0===e?void 0:e.valid):t.valid},isValidByGroup:function(n,e){var r=t.groups[n];if(!r)return!1;if(e)return _t(r,e);for(var u in r)if(!_t(r,u))return!1;return!0}};return n}function Ct(t,n,e){return St(t.tests,n,e)}function It(t,n,e,r){return St(t.groups[e],n,r)}function _t(t,n){var e;return!!(null===(e=t[n])||void 0===e?void 0:e.valid)}function At(t,n,e,r){var u,i,o=t.groups[e];if(!o)return!1;if(r)return N(null===(u=o[r])||void 0===u?void 0:u[n]);for(var s in o)if(N(null===(i=o[s])||void 0===i?void 0:i[n]))return!0;return!1}function Ot(t,n,e){var r,u=e?null===(r=t.tests[e])||void 0===r?void 0:r[n]:t[n]||0;return N(u)}!function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=1]="Delayed"}(ft||(ft={}));var bt=r(1);function kt(){var t=B(),n={stateRef:L()};return bt([t],k.bind(n,(function(){var t=yt(),n=L().suiteName()[0];return e(t,Tt(t),{suiteName:n})})))}function Lt(t){var n=X();return!E(n)&&(!t||n.some((function(n){return ct(n,t)})))}var Ut=r(20);function Dt(){var t=B(),n={stateRef:L()};return Ut([t],k.bind(n,(function(){return e({},kt(),{done:k.bind(n,Gt)})})))}function Ft(t,n,e){var r;return!!(!f(t)||n&&h(null===(r=e.tests[n])||void 0===r?void 0:r.testCount,0))}function Pt(t){return!(Lt()&&(!t||Lt(t)))}var Wt,Gt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=t.reverse(),r=e[0],u=e[1],i=Dt();if(Ft(r,u,i))return i;var o=function(){return r(kt())};return Pt(u)?(o(),i):(wt(o,u),i)};function wt(t,n){(0,D()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function xt(){var t=F()[0];if(!E(t)){var n={};B().forEach((function(t){g(n,t.fieldName)?e(t):function(t){var r=W(t.fieldName);r.type===ft.Immediate&&(n[t.fieldName]=v(r.rule),e(t))}(t)})),w()}function e(t){n[t.fieldName]&&(t.omit(),P(t.fieldName,(function(){return{applied:!0}})))}}function Xt(){var t=R.createBus();return t.on(Wt.TEST_COMPLETED,(function(n){var e,r;n.isCanceled()||(n.done(),e=n.fieldName,r=D()[0].fieldCallbacks,e&&!Lt(e)&&p(r[e])&&y(r[e]),Lt()||t.emit(Wt.ALL_RUNNING_TESTS_FINISHED))})),t.on(Wt.SUITE_CALLBACK_DONE_RUNNING,(function(){xt()})),t.on(Wt.ALL_RUNNING_TESTS_FINISHED,(function(){var t;t=D()[0].doneCallbacks,y(t)})),t.on(Wt.REMOVE_FIELD,(function(t){M((function(n){ct(n,t)&&(n.cancel(),function(t){x((function(n){return i.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(Wt.RESET_FIELD,(function(t){M((function(n){ct(n,t)&&n.reset()}))})),t}function Ht(){var t=k.useX();return c(t.bus),t.bus}function Kt(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.reverse(),u=r[0],i=r[1];c(f(u),"vest.create: Expected callback to be a function.");var s=Xt(),a=_(),l=et(a,{suiteId:o(),suiteName:i}),d={stateRef:l,bus:s},p=e(k.bind(d,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return a.reset(),ot({type:A.SUITE},(function(){u.apply(void 0,t)})),s.emit(Wt.SUITE_CALLBACK_DONE_RUNNING),Dt()})),{get:k.bind(d,kt),remove:k.bind(d,(function(t){s.emit(Wt.REMOVE_FIELD,t)})),reset:a.reset,resetField:k.bind(d,(function(t){s.emit(Wt.RESET_FIELD,t)}))});return p}function Bt(t,n){c(f(n),"each callback must be a function"),ot({type:A.EACH},(function(){t.forEach((function(t,e){n(t,e)}))}))}!function(t){t.TEST_COMPLETED="test_completed",t.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",t.REMOVE_FIELD="remove_field",t.RESET_FIELD="reset_field",t.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running"}(Wt||(Wt={}));function Mt(t,n){ot({type:A.SKIP_WHEN},(function(){k.run({skipped:qt()||v(t,v(kt))},(function(){return n()}))}))}function qt(){return!!k.useX().skipped}function Vt(t){return Jt(0,"tests",t)}function jt(t){return Jt(1,"tests",t)}function Yt(t){var n=t.fieldName,e=t.groupName;if(qt())return!0;var r=k.useX(),u=r.exclusion,i=r.inclusion,o=u.tests,s=o[n];if(!1===s)return!0;var a=!0===s;if(e){if(function(t){var n=k.useX().exclusion.groups;if(g(n,t))return!1===n[t];return Qt()}(e))return!0;if(!0===u.groups[e])return!a&&(!!zt(o)||!1===o[n])}return!!function(t){if(!Qt())return!1;return!t}(e)||!a&&(!!zt(o)&&!v(i[n]))}function Jt(t,e,r){var i=k.useX("hook called outside of a running suite.");r&&u(r).forEach((function(r){n(r)&&(i.exclusion[e][r]=0===t)}))}function zt(t){for(var n in t)if(!0===t[n])return!0;return!1}function Qt(){var t=k.useX().exclusion;for(var n in t.groups)if(t.groups[n])return!0;return!1}function Zt(t,e){c(n(t),$t("name must be a string")),c(f(e),$t("callback must be a function")),ot({type:A.GROUP},(function(){k.run({groupName:t},e)}))}function $t(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function tn(t){var e=k.useX(),r=e.inclusion,u=e.exclusion;return c(n(t)),r[t]=S(u.tests[t],!0),{when:function(e){var r=k.useX(),u=r.inclusion,i=r.exclusion;u[t]=function(){return g(i.tests,t)?S(i.tests[t],!0):n(e)?Boolean(i.tests[e]):v(e,v(kt))}}}}function nn(){var t;t=O.EAGER,k.useX().mode[0]=t}function en(t){return n=O.EAGER,k.useX().mode[0]===n&&dt(t.fieldName);var n}function rn(t,n){ot({type:A.OMIT_WHEN},(function(){k.run({omitted:un()||v(t,v(kt))},(function(){return n()}))}))}function un(){return!!k.useX().omitted}function on(t,n,e){if(e||2===arguments.length)for(var r,u=0,i=n.length;u<i;u++)!r&&u in n||(r||(r=Array.prototype.slice.call(n,0,u)),r[u]=n[u]);return t.concat(r||Array.prototype.slice.call(n))}function sn(t,n){return t.fieldName===n.fieldName&&t.groupName===n.groupName}function an(t){var e=t.asyncTest,r=t.message;if(T(e)){var u=Ht().emit,i=L(),o=k.bind({stateRef:i},(function(){w(),u(Wt.TEST_COMPLETED,t)})),s=k.bind({stateRef:i},(function(e){t.isCanceled()||(t.message=n(e)?e:r,t.fail(),o())}));e.then(o,s)}}function cn(t){var n=Ht(),e=function(t){return k.run({currentTest:t},(function(){return t.run()}))}(t);try{T(e)?(t.asyncTest=e,t.setPending(),an(t)):n.emit(Wt.TEST_COMPLETED,t)}catch(n){throw new Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}function fn(t){var n=G()[0].prev;if(E(n))return ln(t),t;var e,r,u,o=(e=n,r=ut(),i.valueAtPath(e,r));if(!s(t.key)){var c=function(t,n){var e=function(t){return rt().keys.prev[t]}(t),r=n;e&&(r=e);return function(t,n){var e=rt().keys.current;s(e[t])?e[t]=n:a('Encountered the same test key "'.concat(t,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted."))}(t,r),r}(t.key,t);return ln(c),c}(function(t,n){return m(t)&&!sn(t,n)})(o,t)&&(!function(t,n){if(rt().type===A.EACH)return;a("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(t.fieldName,"\n received: ").concat(n.fieldName,'\n This can happen on one of two reasons:\n 1. You\'re using if/else statements to conditionally select tests. Instead, use "skipWhen".\n 2. You are iterating over a list of tests, and their order changed. Use "each" and a custom key prop so that Vest retains their state.'))}(o,t),u=it().current(),x((function(t){return t.splice(u),t})),o=null);var f=S(o,t);return ln(f),f}function ln(t){var n=ut();x((function(e){return i.setValueAtPath(e,n,t)}))}function dn(t){var n=it();if(en(t))return t.skip(),fn(t),n.next(),t;var e,r,u=fn(t);return un()||Et(t.fieldName)?(u.omit(),n.next(),u):Yt(t)?(u.skip(qt()),n.next(),u):((r=t)!==(e=u)&&sn(e,r)&&e.isPending()&&e.cancel(),ln(t),function(t){t.isUntested()?cn(t):T(t.asyncTest)&&(t.setPending(),an(t))}(t),n.next(),t)}function pn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var u=f(e[1])?e:on([void 0],e,!0),i=u[0],o=u[1],s=u[2];c(n(t),En("fieldName","string")),c(f(o),En("Test callback","function"));var a=k.useX(),l=new j(t,o,{message:i,groupName:a.groupName,key:s});return dn(l)}Vt.group=function(t){return Jt(0,"groups",t)},jt.group=function(t){return Jt(1,"groups",t)};var vn=e(pn,{memo:function(t){var n=r(10);return function(e){for(var r=[],u=1;u<arguments.length;u++)r[u-1]=arguments[u];var i=it().current(),o=r.reverse(),s=o[0],a=o[1],c=o[2],f=[U(),e,i].concat(s),l=n.get(f);return C(l)?n(f,(function(){return t(e,c,a)})):l[1].isCanceled()?(n.invalidate(f),n(f,(function(){return t(e,c,a)}))):dn(l[1])}}(pn)});function En(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}function mn(){var t=k.useX("warn hook called outside of a running suite.");c(t.currentTest,"warn called outside of a test."),t.currentTest.warn()}var Nn="4.6.2-dev-b9b126";export{Nn as VERSION,k as context,Kt as create,Bt as each,nn as eager,Zt as group,tn as include,rn as omitWhen,Vt as only,vt as optional,jt as skip,Mt as skipWhen,Tt as suiteSelectors,vn as test,mn as warn};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('vest-utils'), require('vest')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['vest-utils', 'vest'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.classnames = factory(global[
|
|
5
|
-
}(this, (function (vestUtils, vest) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.classnames = factory(global["vest-utils"], global.vest));
|
|
5
|
+
})(this, (function (vestUtils, vest) { 'use strict';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line max-statements
|
|
8
8
|
function parse(summary) {
|
|
@@ -54,4 +54,4 @@
|
|
|
54
54
|
|
|
55
55
|
return classnames;
|
|
56
56
|
|
|
57
|
-
}))
|
|
57
|
+
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
!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){"use strict";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=[];for(var r in n){var o=r;t.isFunction(i[o])&&i[o](e)&&s.push(n[o])}return s.join(" ")}}}));
|
|
@@ -1,63 +1,15 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}(this, (function (
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('n4s/compose')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['n4s/compose'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.compose = factory(global.compose));
|
|
5
|
+
})(this, (function (compose) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
var output = { pass: pass };
|
|
9
|
-
if (message) {
|
|
10
|
-
output.message = message;
|
|
11
|
-
}
|
|
12
|
-
return output;
|
|
13
|
-
}
|
|
14
|
-
function failing() {
|
|
15
|
-
return ruleReturn(false);
|
|
16
|
-
}
|
|
17
|
-
function passing() {
|
|
18
|
-
return ruleReturn(true);
|
|
19
|
-
}
|
|
20
|
-
function defaultToPassing(callback) {
|
|
21
|
-
return vestUtils.defaultTo(callback, passing());
|
|
22
|
-
}
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
8
|
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
return lazyRule.run(currentValue);
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
return failing();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
9
|
+
var compose__default = /*#__PURE__*/_interopDefaultLegacy(compose);
|
|
32
10
|
|
|
33
|
-
/* eslint-disable max-lines-per-function */
|
|
34
|
-
function compose() {
|
|
35
|
-
var composites = [];
|
|
36
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
37
|
-
composites[_i] = arguments[_i];
|
|
38
|
-
}
|
|
39
|
-
return vestUtils.assign(function (value) {
|
|
40
|
-
var res = run(value);
|
|
41
|
-
vestUtils.invariant(res.pass, vestUtils.StringObject(res.message));
|
|
42
|
-
}, {
|
|
43
|
-
run: run,
|
|
44
|
-
test: function (value) { return run(value).pass; }
|
|
45
|
-
});
|
|
46
|
-
function run(value) {
|
|
47
|
-
return n4s.ctx.run({ value: value }, function () {
|
|
48
|
-
return defaultToPassing(vestUtils.mapFirst(composites, function (composite, breakout) {
|
|
49
|
-
/* HACK: Just a small white lie. ~~HELP WANTED~~.
|
|
50
|
-
The ideal is that instead of `LazyRuleRunners` We would simply use `Lazy` to begin with.
|
|
51
|
-
The problem is that lazy rules can't really be passed to this function due to some generic hell
|
|
52
|
-
so we're limiting it to a small set of functions.
|
|
53
|
-
*/
|
|
54
|
-
var res = runLazyRule(composite, value);
|
|
55
|
-
breakout(!res.pass, res);
|
|
56
|
-
}));
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
11
|
|
|
61
|
-
return compose;
|
|
62
12
|
|
|
63
|
-
|
|
13
|
+
return compose__default["default"];
|
|
14
|
+
|
|
15
|
+
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("n4s/compose")):"function"==typeof define&&define.amd?define(["n4s/compose"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).compose=o(e.compose)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}return o(e).default}));
|
|
@@ -1,95 +1,8 @@
|
|
|
1
|
-
(function (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}(this, (function (n4s, vestUtils) { 'use strict';
|
|
1
|
+
(function (factory) {
|
|
2
|
+
typeof define === 'function' && define.amd ? define(['n4s/compounds'], factory) :
|
|
3
|
+
factory();
|
|
4
|
+
})((function () { 'use strict';
|
|
6
5
|
|
|
7
|
-
function ruleReturn(pass, message) {
|
|
8
|
-
var output = { pass: pass };
|
|
9
|
-
if (message) {
|
|
10
|
-
output.message = message;
|
|
11
|
-
}
|
|
12
|
-
return output;
|
|
13
|
-
}
|
|
14
|
-
function failing() {
|
|
15
|
-
return ruleReturn(false);
|
|
16
|
-
}
|
|
17
|
-
function passing() {
|
|
18
|
-
return ruleReturn(true);
|
|
19
|
-
}
|
|
20
|
-
function defaultToFailing(callback) {
|
|
21
|
-
return vestUtils.defaultTo(callback, failing());
|
|
22
|
-
}
|
|
23
|
-
function defaultToPassing(callback) {
|
|
24
|
-
return vestUtils.defaultTo(callback, passing());
|
|
25
|
-
}
|
|
26
6
|
|
|
27
|
-
function runLazyRule(lazyRule, currentValue) {
|
|
28
|
-
try {
|
|
29
|
-
return lazyRule.run(currentValue);
|
|
30
|
-
}
|
|
31
|
-
catch (_a) {
|
|
32
|
-
return failing();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
7
|
|
|
36
|
-
|
|
37
|
-
var rules = [];
|
|
38
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
39
|
-
rules[_i - 1] = arguments[_i];
|
|
40
|
-
}
|
|
41
|
-
return defaultToPassing(vestUtils.mapFirst(rules, function (rule, breakout) {
|
|
42
|
-
var res = runLazyRule(rule, value);
|
|
43
|
-
breakout(!res.pass, res);
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function anyOf(value) {
|
|
48
|
-
var rules = [];
|
|
49
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
50
|
-
rules[_i - 1] = arguments[_i];
|
|
51
|
-
}
|
|
52
|
-
return defaultToFailing(vestUtils.mapFirst(rules, function (rule, breakout) {
|
|
53
|
-
var res = runLazyRule(rule, value);
|
|
54
|
-
breakout(res.pass, res);
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function noneOf(value) {
|
|
59
|
-
var rules = [];
|
|
60
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
61
|
-
rules[_i - 1] = arguments[_i];
|
|
62
|
-
}
|
|
63
|
-
return defaultToPassing(vestUtils.mapFirst(rules, function (rule, breakout) {
|
|
64
|
-
var res = runLazyRule(rule, value);
|
|
65
|
-
breakout(res.pass, failing());
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function equals(value, arg1) {
|
|
70
|
-
return value === arg1;
|
|
71
|
-
}
|
|
72
|
-
vestUtils.bindNot(equals);
|
|
73
|
-
|
|
74
|
-
var REQUIRED_COUNT = 1;
|
|
75
|
-
function oneOf(value) {
|
|
76
|
-
var rules = [];
|
|
77
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
78
|
-
rules[_i - 1] = arguments[_i];
|
|
79
|
-
}
|
|
80
|
-
var passingCount = 0;
|
|
81
|
-
rules.some(function (rule) {
|
|
82
|
-
var res = runLazyRule(rule, value);
|
|
83
|
-
if (res.pass) {
|
|
84
|
-
passingCount++;
|
|
85
|
-
}
|
|
86
|
-
if (vestUtils.greaterThan(passingCount, REQUIRED_COUNT)) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
return ruleReturn(equals(passingCount, REQUIRED_COUNT));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
n4s.enforce.extend({ allOf: allOf, anyOf: anyOf, noneOf: noneOf, oneOf: oneOf });
|
|
94
|
-
|
|
95
|
-
})));
|
|
8
|
+
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
!function(n){"function"==typeof define&&define.amd?define(["n4s/compounds"],n):n()}((function(){}));
|
|
@@ -1,95 +1,8 @@
|
|
|
1
|
-
(function (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}(this, (function (exports, n4s, vestUtils) { 'use strict';
|
|
1
|
+
(function (factory) {
|
|
2
|
+
typeof define === 'function' && define.amd ? define(['n4s/schema'], factory) :
|
|
3
|
+
factory();
|
|
4
|
+
})((function () { 'use strict';
|
|
6
5
|
|
|
7
|
-
function ruleReturn(pass, message) {
|
|
8
|
-
var output = { pass: pass };
|
|
9
|
-
if (message) {
|
|
10
|
-
output.message = message;
|
|
11
|
-
}
|
|
12
|
-
return output;
|
|
13
|
-
}
|
|
14
|
-
function failing() {
|
|
15
|
-
return ruleReturn(false);
|
|
16
|
-
}
|
|
17
|
-
function passing() {
|
|
18
|
-
return ruleReturn(true);
|
|
19
|
-
}
|
|
20
|
-
function defaultToPassing(callback) {
|
|
21
|
-
return vestUtils.defaultTo(callback, passing());
|
|
22
|
-
}
|
|
23
6
|
|
|
24
|
-
function runLazyRule(lazyRule, currentValue) {
|
|
25
|
-
try {
|
|
26
|
-
return lazyRule.run(currentValue);
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
return failing();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
7
|
|
|
33
|
-
|
|
34
|
-
return defaultToPassing(vestUtils.mapFirst(inputArray, function (currentValue, breakout, index) {
|
|
35
|
-
var res = n4s.ctx.run({ value: currentValue, set: true, meta: { index: index } }, function () { return runLazyRule(currentRule, currentValue); });
|
|
36
|
-
breakout(!res.pass, res);
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function loose(inputObject, shapeObject) {
|
|
41
|
-
var _loop_1 = function (key) {
|
|
42
|
-
var currentValue = inputObject[key];
|
|
43
|
-
var currentRule = shapeObject[key];
|
|
44
|
-
var res = n4s.ctx.run({ value: currentValue, set: true, meta: { key: key } }, function () {
|
|
45
|
-
return runLazyRule(currentRule, currentValue);
|
|
46
|
-
});
|
|
47
|
-
if (!res.pass) {
|
|
48
|
-
return { value: res };
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
for (var key in shapeObject) {
|
|
52
|
-
var state_1 = _loop_1(key);
|
|
53
|
-
if (typeof state_1 === "object")
|
|
54
|
-
return state_1.value;
|
|
55
|
-
}
|
|
56
|
-
return passing();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function optional(value, ruleChain) {
|
|
60
|
-
if (vestUtils.isNullish(value)) {
|
|
61
|
-
return passing();
|
|
62
|
-
}
|
|
63
|
-
return runLazyRule(ruleChain, value);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function shape(inputObject, shapeObject) {
|
|
67
|
-
var baseRes = loose(inputObject, shapeObject);
|
|
68
|
-
if (!baseRes.pass) {
|
|
69
|
-
return baseRes;
|
|
70
|
-
}
|
|
71
|
-
for (var key in inputObject) {
|
|
72
|
-
if (!vestUtils.hasOwnProperty(shapeObject, key)) {
|
|
73
|
-
return failing();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return passing();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Help needed improving the typings of this file.
|
|
80
|
-
// Ideally, we'd be able to extend ShapeObject, but that's not possible.
|
|
81
|
-
function partial(shapeObject) {
|
|
82
|
-
var output = {};
|
|
83
|
-
for (var key in shapeObject) {
|
|
84
|
-
output[key] = n4s.enforce.optional(shapeObject[key]);
|
|
85
|
-
}
|
|
86
|
-
return output;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
n4s.enforce.extend({ isArrayOf: isArrayOf, loose: loose, optional: optional, shape: shape });
|
|
90
|
-
|
|
91
|
-
exports.partial = partial;
|
|
92
|
-
|
|
93
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
94
|
-
|
|
95
|
-
})));
|
|
8
|
+
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
!function(n){"function"==typeof define&&define.amd?define(["n4s/schema"],n):n()}((function(){}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vest'), require('vest
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vest', 'vest
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.parser = {}, global
|
|
5
|
-
}(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vest-utils'), require('vest')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vest-utils', 'vest'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.parser = {}, global["vest-utils"], global.vest));
|
|
5
|
+
})(this, (function (exports, vestUtils, vest) { 'use strict';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line max-statements
|
|
8
8
|
function parse(summary) {
|
|
@@ -38,4 +38,4 @@
|
|
|
38
38
|
|
|
39
39
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
40
40
|
|
|
41
|
-
}))
|
|
41
|
+
}));
|