vest 5.0.4 → 5.0.5
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/SuiteSerializer.development.js +1 -0
- package/dist/cjs/SuiteSerializer.development.js.map +1 -0
- package/dist/cjs/SuiteSerializer.production.js +1 -0
- package/dist/cjs/SuiteSerializer.production.js.map +1 -0
- package/dist/cjs/classnames.development.js +1 -0
- package/dist/cjs/classnames.development.js.map +1 -0
- package/dist/cjs/classnames.production.js +1 -0
- package/dist/cjs/classnames.production.js.map +1 -0
- package/dist/cjs/enforce/compose.development.js +1 -0
- package/dist/cjs/enforce/compose.development.js.map +1 -0
- package/dist/cjs/enforce/compose.production.js +1 -0
- package/dist/cjs/enforce/compose.production.js.map +1 -0
- package/dist/cjs/enforce/compounds.development.js +1 -0
- package/dist/cjs/enforce/compounds.development.js.map +1 -0
- package/dist/cjs/enforce/compounds.production.js +1 -0
- package/dist/cjs/enforce/compounds.production.js.map +1 -0
- package/dist/cjs/enforce/date.development.js +1 -0
- package/dist/cjs/enforce/date.development.js.map +1 -0
- package/dist/cjs/enforce/date.production.js +1 -0
- package/dist/cjs/enforce/date.production.js.map +1 -0
- package/dist/cjs/enforce/email.development.js +1 -0
- package/dist/cjs/enforce/email.development.js.map +1 -0
- package/dist/cjs/enforce/email.production.js +1 -0
- package/dist/cjs/enforce/email.production.js.map +1 -0
- package/dist/cjs/enforce/isURL.development.js +1 -0
- package/dist/cjs/enforce/isURL.development.js.map +1 -0
- package/dist/cjs/enforce/isURL.production.js +1 -0
- package/dist/cjs/enforce/isURL.production.js.map +1 -0
- package/dist/cjs/enforce/schema.development.js +1 -0
- package/dist/cjs/enforce/schema.development.js.map +1 -0
- package/dist/cjs/enforce/schema.production.js +1 -0
- package/dist/cjs/enforce/schema.production.js.map +1 -0
- package/dist/cjs/parser.development.js +1 -0
- package/dist/cjs/parser.development.js.map +1 -0
- package/dist/cjs/parser.production.js +1 -0
- package/dist/cjs/parser.production.js.map +1 -0
- package/dist/cjs/promisify.development.js +1 -0
- package/dist/cjs/promisify.development.js.map +1 -0
- package/dist/cjs/promisify.production.js +1 -0
- package/dist/cjs/promisify.production.js.map +1 -0
- package/dist/cjs/vest.development.js +1 -0
- package/dist/cjs/vest.development.js.map +1 -0
- package/dist/cjs/vest.production.js +1 -0
- package/dist/cjs/vest.production.js.map +1 -0
- package/dist/es/SuiteSerializer.development.js +1 -0
- package/dist/es/SuiteSerializer.development.js.map +1 -0
- package/dist/es/SuiteSerializer.production.js +1 -0
- package/dist/es/SuiteSerializer.production.js.map +1 -0
- package/dist/es/classnames.development.js +1 -0
- package/dist/es/classnames.development.js.map +1 -0
- package/dist/es/classnames.production.js +1 -0
- package/dist/es/classnames.production.js.map +1 -0
- package/dist/es/enforce/compose.development.js +1 -0
- package/dist/es/enforce/compose.development.js.map +1 -0
- package/dist/es/enforce/compose.production.js +1 -0
- package/dist/es/enforce/compose.production.js.map +1 -0
- package/dist/es/enforce/compounds.development.js +1 -0
- package/dist/es/enforce/compounds.development.js.map +1 -0
- package/dist/es/enforce/compounds.production.js +1 -0
- package/dist/es/enforce/compounds.production.js.map +1 -0
- package/dist/es/enforce/date.development.js +1 -0
- package/dist/es/enforce/date.development.js.map +1 -0
- package/dist/es/enforce/date.production.js +1 -0
- package/dist/es/enforce/date.production.js.map +1 -0
- package/dist/es/enforce/email.development.js +1 -0
- package/dist/es/enforce/email.development.js.map +1 -0
- package/dist/es/enforce/email.production.js +1 -0
- package/dist/es/enforce/email.production.js.map +1 -0
- package/dist/es/enforce/isURL.development.js +1 -0
- package/dist/es/enforce/isURL.development.js.map +1 -0
- package/dist/es/enforce/isURL.production.js +1 -0
- package/dist/es/enforce/isURL.production.js.map +1 -0
- package/dist/es/enforce/schema.development.js +1 -0
- package/dist/es/enforce/schema.development.js.map +1 -0
- package/dist/es/enforce/schema.production.js +1 -0
- package/dist/es/enforce/schema.production.js.map +1 -0
- package/dist/es/parser.development.js +1 -0
- package/dist/es/parser.development.js.map +1 -0
- package/dist/es/parser.production.js +1 -0
- package/dist/es/parser.production.js.map +1 -0
- package/dist/es/promisify.development.js +1 -0
- package/dist/es/promisify.development.js.map +1 -0
- package/dist/es/promisify.production.js +1 -0
- package/dist/es/promisify.production.js.map +1 -0
- package/dist/es/vest.development.js +1 -0
- package/dist/es/vest.development.js.map +1 -0
- package/dist/es/vest.production.js +1 -0
- package/dist/es/vest.production.js.map +1 -0
- package/dist/umd/SuiteSerializer.development.js +1 -0
- package/dist/umd/SuiteSerializer.development.js.map +1 -0
- package/dist/umd/SuiteSerializer.production.js +1 -0
- package/dist/umd/SuiteSerializer.production.js.map +1 -0
- package/dist/umd/classnames.development.js +1 -0
- package/dist/umd/classnames.development.js.map +1 -0
- package/dist/umd/classnames.production.js +1 -0
- package/dist/umd/classnames.production.js.map +1 -0
- package/dist/umd/enforce/compose.development.js +1 -0
- package/dist/umd/enforce/compose.development.js.map +1 -0
- package/dist/umd/enforce/compose.production.js +1 -0
- package/dist/umd/enforce/compose.production.js.map +1 -0
- package/dist/umd/enforce/compounds.development.js +1 -0
- package/dist/umd/enforce/compounds.development.js.map +1 -0
- package/dist/umd/enforce/compounds.production.js +1 -0
- package/dist/umd/enforce/compounds.production.js.map +1 -0
- package/dist/umd/enforce/date.development.js +1 -0
- package/dist/umd/enforce/date.development.js.map +1 -0
- package/dist/umd/enforce/date.production.js +1 -0
- package/dist/umd/enforce/date.production.js.map +1 -0
- package/dist/umd/enforce/email.development.js +1 -0
- package/dist/umd/enforce/email.development.js.map +1 -0
- package/dist/umd/enforce/email.production.js +1 -0
- package/dist/umd/enforce/email.production.js.map +1 -0
- package/dist/umd/enforce/isURL.development.js +1 -0
- package/dist/umd/enforce/isURL.development.js.map +1 -0
- package/dist/umd/enforce/isURL.production.js +1 -0
- package/dist/umd/enforce/isURL.production.js.map +1 -0
- package/dist/umd/enforce/schema.development.js +1 -0
- package/dist/umd/enforce/schema.development.js.map +1 -0
- package/dist/umd/enforce/schema.production.js +1 -0
- package/dist/umd/enforce/schema.production.js.map +1 -0
- package/dist/umd/parser.development.js +1 -0
- package/dist/umd/parser.development.js.map +1 -0
- package/dist/umd/parser.production.js +1 -0
- package/dist/umd/parser.production.js.map +1 -0
- package/dist/umd/promisify.development.js +1 -0
- package/dist/umd/promisify.development.js.map +1 -0
- package/dist/umd/promisify.production.js +1 -0
- package/dist/umd/promisify.production.js.map +1 -0
- package/dist/umd/vest.development.js +1 -0
- package/dist/umd/vest.development.js.map +1 -0
- package/dist/umd/vest.production.js +1 -0
- package/dist/umd/vest.production.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuiteSerializer.development.js","sources":["../../src/exports/SuiteSerializer.ts"],"sourcesContent":["import { IsolateSerializer } from 'vestjs-runtime';\n\nimport { TIsolateSuite } from 'IsolateSuite';\nimport { TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { Suite } from 'SuiteTypes';\n\nexport class SuiteSerializer {\n static serialize(suite: Suite<TFieldName, TGroupName>) {\n const dump = { ...suite.dump(), output: undefined };\n\n return IsolateSerializer.serialize(dump);\n }\n\n static deserialize(\n serialized: string | TIsolateSuite | Record<string, any>\n ): TIsolateSuite {\n return IsolateSerializer.deserialize(serialized) as TIsolateSuite;\n }\n\n static resume(\n suite: Suite<TFieldName, TGroupName>,\n root: string | TIsolateSuite | Record<string, any>\n ): void {\n const suiteRoot = SuiteSerializer.deserialize(root);\n\n suite.resume(suiteRoot);\n }\n}\n"],"names":["IsolateSerializer"],"mappings":";;;;MAMa,eAAe,CAAA;IAC1B,OAAO,SAAS,CAAC,KAAoC,EAAA;QACnD,MAAM,IAAI,GAAQ,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAAC,IAAI,EAAE,CAAA,EAAA,EAAE,MAAM,EAAE,SAAS,EAAA,CAAE,CAAC;AAEpD,QAAA,OAAOA,+BAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;KAC1C;IAED,OAAO,WAAW,CAChB,UAAwD,EAAA;AAExD,QAAA,OAAOA,+BAAiB,CAAC,WAAW,CAAC,UAAU,CAAkB,CAAC;KACnE;AAED,IAAA,OAAO,MAAM,CACX,KAAoC,EACpC,IAAkD,EAAA;QAElD,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAEpD,QAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KACzB;AACF;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";var e=require("vestjs-runtime");class i{static serialize(i){const s=Object.assign(Object.assign({},i.dump()),{output:void 0});return e.IsolateSerializer.serialize(s)}static deserialize(i){return e.IsolateSerializer.deserialize(i)}static resume(e,s){const r=i.deserialize(s);e.resume(r)}}exports.SuiteSerializer=i;
|
|
2
|
+
//# sourceMappingURL=SuiteSerializer.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuiteSerializer.production.js","sources":["../../src/exports/SuiteSerializer.ts"],"sourcesContent":["import { IsolateSerializer } from 'vestjs-runtime';\n\nimport { TIsolateSuite } from 'IsolateSuite';\nimport { TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { Suite } from 'SuiteTypes';\n\nexport class SuiteSerializer {\n static serialize(suite: Suite<TFieldName, TGroupName>) {\n const dump = { ...suite.dump(), output: undefined };\n\n return IsolateSerializer.serialize(dump);\n }\n\n static deserialize(\n serialized: string | TIsolateSuite | Record<string, any>\n ): TIsolateSuite {\n return IsolateSerializer.deserialize(serialized) as TIsolateSuite;\n }\n\n static resume(\n suite: Suite<TFieldName, TGroupName>,\n root: string | TIsolateSuite | Record<string, any>\n ): void {\n const suiteRoot = SuiteSerializer.deserialize(root);\n\n suite.resume(suiteRoot);\n }\n}\n"],"names":["SuiteSerializer","static","suite","dump","Object","assign","output","undefined","IsolateSerializer","serialize","serialized","deserialize","root","suiteRoot","resume"],"mappings":"mDAMaA,EACXC,iBAAiBC,GACf,MAAMC,EAAYC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAH,EAAMC,QAAM,CAAEG,YAAQC,IAExC,OAAOC,EAAiBA,kBAACC,UAAUN,EACpC,CAEDF,mBACES,GAEA,OAAOF,EAAiBA,kBAACG,YAAYD,EACtC,CAEDT,cACEC,EACAU,GAEA,MAAMC,EAAYb,EAAgBW,YAAYC,GAE9CV,EAAMY,OAAOD,EACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classnames.development.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts","../../src/exports/classnames.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { suiteSelectors } from 'vest';\nimport { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n","import { isFunction } from 'vest-utils';\n\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { ParsedVestObject, parse } from 'parser';\n\n/**\n * Creates a function that returns class names that match the validation result\n */\nexport default function classnames<F extends TFieldName, G extends TGroupName>(\n res: SuiteSummary<F, G>,\n classes: SupportedClasses = {}\n): (fieldName: F) => string {\n const selectors = parse(res);\n\n return function cn(fieldName: F): string {\n const classesArray: string[] = [];\n\n for (const selector in classes) {\n const sel = selector as keyof SupportedClasses;\n if (isFunction(selectors[sel]) && selectors[sel](fieldName)) {\n classesArray.push(classes[sel] as string);\n }\n }\n\n return classesArray.join(' ');\n };\n}\n\ntype SupportedClasses = {\n [K in keyof ParsedVestObject<TFieldName>]?: string;\n};\n"],"names":["invariant","hasOwnProperty","suiteSelectors","isNullish","isPositive","isFunction"],"mappings":"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"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";var e,t=require("vest-utils"),s=require("vest");!function(e){e.HOOK_CALLED_OUTSIDE="hook called outside of a running suite.",e.EXPECTED_VEST_TEST="Expected value to be an instance of IsolateTest",e.FIELD_NAME_REQUIRED="Field name must be passed",e.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION="Suite must be initialized with a function",e.PROMISIFY_REQUIRE_FUNCTION="Vest.Promisify must be called with a function",e.PARSER_EXPECT_RESULT_OBJECT="Vest parser: expected argument at position 0 to be Vest's result object.",e.WARN_MUST_BE_CALLED_FROM_TEST="Warn must be called from within the body of a test function",e.EACH_CALLBACK_MUST_BE_A_FUNCTION="Each must be called with a function",e.INVALID_PARAM_PASSED_TO_FUNCTION='Incompatible params passed to {fn_name} function. "{param}" must be of type {expected}',e.TESTS_CALLED_IN_DIFFERENT_ORDER='Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.',e.UNEXPECTED_TEST_REGISTRATION_ERROR="Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.",e.UNEXPECTED_TEST_RUN_ERROR="Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.",e.INCLUDE_SELF="Trying to call include.when on the same field."}(e||(e={})),module.exports=function(n,i={}){const r=function(n){t.invariant(n&&t.hasOwnProperty(n,"valid"),e.PARSER_EXPECT_RESULT_OBJECT);const i=s.suiteSelectors(n),r={},o={invalid:i.hasErrors,pending:i.isPending,tested:function(e){return t.isNullish(e)?t.isPositive(n.testCount):t.hasOwnProperty(r,e)?r[e]:(a(e),o.tested(e))},untested:function(e){return!(t.isPositive(n.testCount)&&o.tested(e))},valid:i.isValid,warning:i.hasWarnings};return o;function a(e){r[e]=t.hasOwnProperty(n.tests,e)&&t.isPositive(n.tests[e].testCount)}}(n);return function(e){const s=[];for(const n in i){const o=n;t.isFunction(r[o])&&r[o](e)&&s.push(i[o])}return s.join(" ")}};
|
|
2
|
+
//# sourceMappingURL=classnames.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classnames.production.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/classnames.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { isFunction } from 'vest-utils';\n\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { ParsedVestObject, parse } from 'parser';\n\n/**\n * Creates a function that returns class names that match the validation result\n */\nexport default function classnames<F extends TFieldName, G extends TGroupName>(\n res: SuiteSummary<F, G>,\n classes: SupportedClasses = {}\n): (fieldName: F) => string {\n const selectors = parse(res);\n\n return function cn(fieldName: F): string {\n const classesArray: string[] = [];\n\n for (const selector in classes) {\n const sel = selector as keyof SupportedClasses;\n if (isFunction(selectors[sel]) && selectors[sel](fieldName)) {\n classesArray.push(classes[sel] as string);\n }\n }\n\n return classesArray.join(' ');\n };\n}\n\ntype SupportedClasses = {\n [K in keyof ParsedVestObject<TFieldName>]?: string;\n};\n","import { suiteSelectors } from 'vest';\nimport { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n"],"names":["ErrorStrings","res","classes","selectors","summary","invariant","hasOwnProperty","PARSER_EXPECT_RESULT_OBJECT","sel","suiteSelectors","testedStorage","invalid","hasErrors","pending","isPending","tested","fieldName","isNullish","isPositive","testCount","addFieldToTestedStorage","untested","valid","isValid","warning","hasWarnings","tests","parse","classesArray","selector","isFunction","push","join"],"mappings":"iBAAYA,6CAAZ,SAAYA,GACVA,EAAA,oBAAA,0CACAA,EAAA,mBAAA,kDACAA,EAAA,oBAAA,4BACAA,EAAA,wCAAA,4CACAA,EAAA,2BAAA,gDACAA,EAAA,4BAAA,2EACAA,EAAA,8BAAA,8DACAA,EAAA,iCAAA,sCACAA,EAAA,iCAAA,yFACAA,EAAA,gCAAA,wZAMAA,EAAA,mCAAA,+KAIAA,EAAA,0BAAA,wIAEAA,EAAA,aAAA,gDACD,CAvBD,CAAYA,IAAAA,EAuBX,CAAA,mBCfuB,SACtBC,EACAC,EAA4B,IAE5B,MAAMC,ECNF,SACJC,GAEAC,EAASA,UACPD,GAAWE,iBAAeF,EAAS,SACnCJ,EAAaO,6BAGf,MAAMC,EAAMC,iBAAeL,GAErBM,EAAyC,CAAA,EAEzCP,EAAY,CAChBQ,QAASH,EAAII,UACbC,QAASL,EAAIM,UACbC,OASF,SAAkBC,GAChB,OAAIC,EAAAA,UAAUD,GACLE,EAAUA,WAACd,EAAQe,WAGxBb,EAAcA,eAACI,EAAeM,GACzBN,EAAcM,IAGvBI,EAAwBJ,GAEjBb,EAAUY,OAAOC,GACzB,EApBCK,SA4BF,SAAoBL,GAClB,QAASE,EAAAA,WAAWd,EAAQe,YAAchB,EAAUY,OAAOC,GAC5D,EA7BCM,MAAOd,EAAIe,QACXC,QAAShB,EAAIiB,aAGf,OAAOtB,EAiBP,SAASiB,EAAwBJ,GAC/BN,EAAcM,GACZV,iBAAeF,EAAQsB,MAAOV,IAC9BE,EAAAA,WAAWd,EAAQsB,MAAMV,GAAWG,UACvC,CAKH,CDzCoBQ,CAAM1B,GAExB,OAAO,SAAYe,GACjB,MAAMY,EAAyB,GAE/B,IAAK,MAAMC,KAAY3B,EAAS,CAC9B,MAAMM,EAAMqB,EACRC,EAAUA,WAAC3B,EAAUK,KAASL,EAAUK,GAAKQ,IAC/CY,EAAaG,KAAK7B,EAAQM,GAE7B,CAED,OAAOoB,EAAaI,KAAK,IAC3B,CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compounds.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/compounds"));exports.compounds=t;
|
|
2
|
+
//# sourceMappingURL=compounds.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compounds.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/date"));exports.date=t;
|
|
2
|
+
//# sourceMappingURL=date.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/email"));exports.email=t;
|
|
2
|
+
//# sourceMappingURL=email.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isURL.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/isURL"));exports.isURL=t;
|
|
2
|
+
//# sourceMappingURL=isURL.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isURL.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/schema"));exports.schema=t;
|
|
2
|
+
//# sourceMappingURL=schema.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.development.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { suiteSelectors } from 'vest';\nimport { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n"],"names":["invariant","hasOwnProperty","suiteSelectors","isNullish","isPositive"],"mappings":";;;;;AAAA,IAAY,YAuBX,CAAA;AAvBD,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,qBAAA,CAAA,GAAA,yCAA+D,CAAA;AAC/D,IAAA,YAAA,CAAA,oBAAA,CAAA,GAAA,iDAAsE,CAAA;AACtE,IAAA,YAAA,CAAA,qBAAA,CAAA,GAAA,2BAAiD,CAAA;AACjD,IAAA,YAAA,CAAA,yCAAA,CAAA,GAAA,2CAAqF,CAAA;AACrF,IAAA,YAAA,CAAA,4BAAA,CAAA,GAAA,+CAA4E,CAAA;AAC5E,IAAA,YAAA,CAAA,6BAAA,CAAA,GAAA,0EAAwG,CAAA;AACxG,IAAA,YAAA,CAAA,+BAAA,CAAA,GAAA,6DAA6F,CAAA;AAC7F,IAAA,YAAA,CAAA,kCAAA,CAAA,GAAA,qCAAwE,CAAA;AACxE,IAAA,YAAA,CAAA,kCAAA,CAAA,GAAA,0FAA2H,CAAA;AAC3H,IAAA,YAAA,CAAA,iCAAA,CAAA,GAAA,0ZAKyI,CAAA;AACzI,IAAA,YAAA,CAAA,oCAAA,CAAA,GAAA,8KAGoB,CAAA;AACpB,IAAA,YAAA,CAAA,2BAAA,CAAA,GAAA,uIAC+B,CAAA;AAC/B,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,gDAA+D,CAAA;AACjE,CAAC,EAvBW,YAAY,KAAZ,YAAY,GAuBvB,EAAA,CAAA,CAAA;;ACjBK,SAAU,KAAK,CACnB,OAA2B,EAAA;AAE3B,IAAAA,mBAAS,CACP,OAAO,IAAIC,wBAAc,CAAC,OAAO,EAAE,OAAO,CAAC,EAC3C,YAAY,CAAC,2BAA2B,CACzC,CAAC;AAEF,IAAA,MAAM,GAAG,GAAGC,mBAAc,CAAC,OAAO,CAAC,CAAC;IAEpC,MAAM,aAAa,GAA4B,EAAE,CAAC;AAElD,IAAA,MAAM,SAAS,GAAG;QAChB,OAAO,EAAE,GAAG,CAAC,SAAS;QACtB,OAAO,EAAE,GAAG,CAAC,SAAS;AACtB,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,GAAG,CAAC,OAAO;QAClB,OAAO,EAAE,GAAG,CAAC,WAAW;KACzB,CAAC;AAEF,IAAA,OAAO,SAAS,CAAC;;IAGjB,SAAS,QAAQ,CAAC,SAAa,EAAA;AAC7B,QAAA,IAAIC,mBAAS,CAAC,SAAS,CAAC,EAAE;AACxB,YAAA,OAAOC,oBAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACtC,SAAA;AAED,QAAA,IAAIH,wBAAc,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE;AAC5C,YAAA,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AACjC,SAAA;QAED,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAEnC,QAAA,OAAO,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KACpC;IAED,SAAS,uBAAuB,CAAC,SAAY,EAAA;QAC3C,aAAa,CAAC,SAAS,CAAC;AACtB,YAAAA,wBAAc,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC;gBACxCG,oBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;KAClD;IAED,SAAS,UAAU,CAAC,SAAa,EAAA;AAC/B,QAAA,OAAO,EAAEA,oBAAU,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;KACxE;AACH;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";var e,t=require("vest"),s=require("vest-utils");!function(e){e.HOOK_CALLED_OUTSIDE="hook called outside of a running suite.",e.EXPECTED_VEST_TEST="Expected value to be an instance of IsolateTest",e.FIELD_NAME_REQUIRED="Field name must be passed",e.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION="Suite must be initialized with a function",e.PROMISIFY_REQUIRE_FUNCTION="Vest.Promisify must be called with a function",e.PARSER_EXPECT_RESULT_OBJECT="Vest parser: expected argument at position 0 to be Vest's result object.",e.WARN_MUST_BE_CALLED_FROM_TEST="Warn must be called from within the body of a test function",e.EACH_CALLBACK_MUST_BE_A_FUNCTION="Each must be called with a function",e.INVALID_PARAM_PASSED_TO_FUNCTION='Incompatible params passed to {fn_name} function. "{param}" must be of type {expected}',e.TESTS_CALLED_IN_DIFFERENT_ORDER='Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.',e.UNEXPECTED_TEST_REGISTRATION_ERROR="Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.",e.UNEXPECTED_TEST_RUN_ERROR="Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.",e.INCLUDE_SELF="Trying to call include.when on the same field."}(e||(e={})),exports.parse=function(n){s.invariant(n&&s.hasOwnProperty(n,"valid"),e.PARSER_EXPECT_RESULT_OBJECT);const i=t.suiteSelectors(n),r={},o={invalid:i.hasErrors,pending:i.isPending,tested:function(e){if(s.isNullish(e))return s.isPositive(n.testCount);if(s.hasOwnProperty(r,e))return r[e];return a(e),o.tested(e)},untested:function(e){return!(s.isPositive(n.testCount)&&o.tested(e))},valid:i.isValid,warning:i.hasWarnings};return o;function a(e){r[e]=s.hasOwnProperty(n.tests,e)&&s.isPositive(n.tests[e].testCount)}};
|
|
2
|
+
//# sourceMappingURL=parser.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.production.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { suiteSelectors } from 'vest';\nimport { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n"],"names":["ErrorStrings","summary","invariant","hasOwnProperty","PARSER_EXPECT_RESULT_OBJECT","sel","suiteSelectors","testedStorage","selectors","invalid","hasErrors","pending","isPending","tested","fieldName","isNullish","isPositive","testCount","addFieldToTestedStorage","untested","valid","isValid","warning","hasWarnings","tests"],"mappings":"iBAAYA,6CAAZ,SAAYA,GACVA,EAAA,oBAAA,0CACAA,EAAA,mBAAA,kDACAA,EAAA,oBAAA,4BACAA,EAAA,wCAAA,4CACAA,EAAA,2BAAA,gDACAA,EAAA,4BAAA,2EACAA,EAAA,8BAAA,8DACAA,EAAA,iCAAA,sCACAA,EAAA,iCAAA,yFACAA,EAAA,gCAAA,wZAMAA,EAAA,mCAAA,+KAIAA,EAAA,0BAAA,wIAEAA,EAAA,aAAA,gDACD,CAvBD,CAAYA,IAAAA,EAuBX,CAAA,kBCjBK,SACJC,GAEAC,EAASA,UACPD,GAAWE,iBAAeF,EAAS,SACnCD,EAAaI,6BAGf,MAAMC,EAAMC,iBAAeL,GAErBM,EAAyC,CAAA,EAEzCC,EAAY,CAChBC,QAASJ,EAAIK,UACbC,QAASN,EAAIO,UACbC,OASF,SAAkBC,GAChB,GAAIC,EAAAA,UAAUD,GACZ,OAAOE,EAAUA,WAACf,EAAQgB,WAG5B,GAAId,EAAcA,eAACI,EAAeO,GAChC,OAAOP,EAAcO,GAKvB,OAFAI,EAAwBJ,GAEjBN,EAAUK,OAAOC,EACzB,EApBCK,SA4BF,SAAoBL,GAClB,QAASE,EAAAA,WAAWf,EAAQgB,YAAcT,EAAUK,OAAOC,GAC5D,EA7BCM,MAAOf,EAAIgB,QACXC,QAASjB,EAAIkB,aAGf,OAAOf,EAiBP,SAASU,EAAwBJ,GAC/BP,EAAcO,GACZX,iBAAeF,EAAQuB,MAAOV,IAC9BE,EAAAA,WAAWf,EAAQuB,MAAMV,GAAWG,UACvC,CAKH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promisify.development.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/promisify.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { invariant, isFunction } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport {\n SuiteResult,\n SuiteRunResult,\n TFieldName,\n TGroupName,\n} from 'SuiteResultTypes';\n\nfunction promisify<F extends TFieldName, G extends TGroupName>(\n validatorFn: (...args: any[]) => SuiteRunResult<F, G>\n) {\n return (...args: any[]): Promise<SuiteResult<F, G>> => {\n invariant(isFunction(validatorFn), ErrorStrings.PROMISIFY_REQUIRE_FUNCTION);\n\n return new Promise(resolve => validatorFn(...args).done(resolve));\n };\n}\n\nexport default promisify;\n"],"names":["invariant","isFunction"],"mappings":";;;;AAAA,IAAY,YAuBX,CAAA;AAvBD,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,qBAAA,CAAA,GAAA,yCAA+D,CAAA;AAC/D,IAAA,YAAA,CAAA,oBAAA,CAAA,GAAA,iDAAsE,CAAA;AACtE,IAAA,YAAA,CAAA,qBAAA,CAAA,GAAA,2BAAiD,CAAA;AACjD,IAAA,YAAA,CAAA,yCAAA,CAAA,GAAA,2CAAqF,CAAA;AACrF,IAAA,YAAA,CAAA,4BAAA,CAAA,GAAA,+CAA4E,CAAA;AAC5E,IAAA,YAAA,CAAA,6BAAA,CAAA,GAAA,0EAAwG,CAAA;AACxG,IAAA,YAAA,CAAA,+BAAA,CAAA,GAAA,6DAA6F,CAAA;AAC7F,IAAA,YAAA,CAAA,kCAAA,CAAA,GAAA,qCAAwE,CAAA;AACxE,IAAA,YAAA,CAAA,kCAAA,CAAA,GAAA,0FAA2H,CAAA;AAC3H,IAAA,YAAA,CAAA,iCAAA,CAAA,GAAA,0ZAKyI,CAAA;AACzI,IAAA,YAAA,CAAA,oCAAA,CAAA,GAAA,8KAGoB,CAAA;AACpB,IAAA,YAAA,CAAA,2BAAA,CAAA,GAAA,uIAC+B,CAAA;AAC/B,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,gDAA+D,CAAA;AACjE,CAAC,EAvBW,YAAY,KAAZ,YAAY,GAuBvB,EAAA,CAAA,CAAA;;ACbD,SAAS,SAAS,CAChB,WAAqD,EAAA;AAErD,IAAA,OAAO,CAAC,GAAG,IAAW,KAAgC;QACpDA,mBAAS,CAACC,oBAAU,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,0BAA0B,CAAC,CAAC;AAE5E,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAI,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AACpE,KAAC,CAAC;AACJ;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";var e,t=require("vest-utils");!function(e){e.HOOK_CALLED_OUTSIDE="hook called outside of a running suite.",e.EXPECTED_VEST_TEST="Expected value to be an instance of IsolateTest",e.FIELD_NAME_REQUIRED="Field name must be passed",e.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION="Suite must be initialized with a function",e.PROMISIFY_REQUIRE_FUNCTION="Vest.Promisify must be called with a function",e.PARSER_EXPECT_RESULT_OBJECT="Vest parser: expected argument at position 0 to be Vest's result object.",e.WARN_MUST_BE_CALLED_FROM_TEST="Warn must be called from within the body of a test function",e.EACH_CALLBACK_MUST_BE_A_FUNCTION="Each must be called with a function",e.INVALID_PARAM_PASSED_TO_FUNCTION='Incompatible params passed to {fn_name} function. "{param}" must be of type {expected}',e.TESTS_CALLED_IN_DIFFERENT_ORDER='Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.',e.UNEXPECTED_TEST_REGISTRATION_ERROR="Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.",e.UNEXPECTED_TEST_RUN_ERROR="Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.",e.INCLUDE_SELF="Trying to call include.when on the same field."}(e||(e={})),module.exports=function(s){return(...n)=>(t.invariant(t.isFunction(s),e.PROMISIFY_REQUIRE_FUNCTION),new Promise((e=>s(...n).done(e))))};
|
|
2
|
+
//# sourceMappingURL=promisify.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promisify.production.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/promisify.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\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.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { invariant, isFunction } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport {\n SuiteResult,\n SuiteRunResult,\n TFieldName,\n TGroupName,\n} from 'SuiteResultTypes';\n\nfunction promisify<F extends TFieldName, G extends TGroupName>(\n validatorFn: (...args: any[]) => SuiteRunResult<F, G>\n) {\n return (...args: any[]): Promise<SuiteResult<F, G>> => {\n invariant(isFunction(validatorFn), ErrorStrings.PROMISIFY_REQUIRE_FUNCTION);\n\n return new Promise(resolve => validatorFn(...args).done(resolve));\n };\n}\n\nexport default promisify;\n"],"names":["ErrorStrings","validatorFn","args","invariant","isFunction","PROMISIFY_REQUIRE_FUNCTION","Promise","resolve","done"],"mappings":"iBAAYA,2BAAZ,SAAYA,GACVA,EAAA,oBAAA,0CACAA,EAAA,mBAAA,kDACAA,EAAA,oBAAA,4BACAA,EAAA,wCAAA,4CACAA,EAAA,2BAAA,gDACAA,EAAA,4BAAA,2EACAA,EAAA,8BAAA,8DACAA,EAAA,iCAAA,sCACAA,EAAA,iCAAA,yFACAA,EAAA,gCAAA,wZAMAA,EAAA,mCAAA,+KAIAA,EAAA,0BAAA,wIAEAA,EAAA,aAAA,gDACD,CAvBD,CAAYA,IAAAA,EAuBX,CAAA,mBCbD,SACEC,GAEA,MAAO,IAAIC,KACTC,EAAAA,UAAUC,EAAAA,WAAWH,GAAcD,EAAaK,4BAEzC,IAAIC,SAAQC,GAAWN,KAAeC,GAAMM,KAAKD,KAE5D"}
|