@bemedev/dev-utils 1.4.0 → 1.5.1
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/README.md +89 -20
- package/lib/_virtual/_rolldown/runtime.cjs +1 -2
- package/lib/build-tests/addTarball.cjs +8 -3
- package/lib/build-tests/addTarball.cjs.map +1 -1
- package/lib/build-tests/addTarball.d.ts +7 -1
- package/lib/build-tests/addTarball.js +8 -3
- package/lib/build-tests/addTarball.js.map +1 -1
- package/lib/build-tests/buildPackageJson.cjs +9 -4
- package/lib/build-tests/buildPackageJson.cjs.map +1 -1
- package/lib/build-tests/buildPackageJson.d.ts +14 -2
- package/lib/build-tests/buildPackageJson.js +9 -4
- package/lib/build-tests/buildPackageJson.js.map +1 -1
- package/lib/build-tests/cleanup.cjs +5 -3
- package/lib/build-tests/cleanup.cjs.map +1 -1
- package/lib/build-tests/cleanup.d.ts +4 -1
- package/lib/build-tests/cleanup.js +5 -3
- package/lib/build-tests/cleanup.js.map +1 -1
- package/lib/build-tests/cli/cli.cjs +6 -4
- package/lib/build-tests/cli/cli.cjs.map +1 -1
- package/lib/build-tests/cli/cli.d.ts +3 -0
- package/lib/build-tests/cli/cli.js +6 -4
- package/lib/build-tests/cli/cli.js.map +1 -1
- package/lib/build-tests/cli/index.cjs +1 -2
- package/lib/build-tests/cli/index.cjs.map +1 -1
- package/lib/build-tests/cli/index.js +1 -2
- package/lib/build-tests/cli/post.cjs +5 -3
- package/lib/build-tests/cli/post.cjs.map +1 -1
- package/lib/build-tests/cli/post.d.ts +4 -1
- package/lib/build-tests/cli/post.js +5 -3
- package/lib/build-tests/cli/post.js.map +1 -1
- package/lib/build-tests/cli/pre.cjs +5 -3
- package/lib/build-tests/cli/pre.cjs.map +1 -1
- package/lib/build-tests/cli/pre.d.ts +4 -1
- package/lib/build-tests/cli/pre.js +5 -3
- package/lib/build-tests/cli/pre.js.map +1 -1
- package/lib/build-tests/cli/test.cjs +4 -2
- package/lib/build-tests/cli/test.cjs.map +1 -1
- package/lib/build-tests/cli/test.d.ts +3 -0
- package/lib/build-tests/cli/test.js +4 -2
- package/lib/build-tests/cli/test.js.map +1 -1
- package/lib/build-tests/constants.cjs +1 -2
- package/lib/build-tests/constants.js +1 -2
- package/lib/build-tests/getRelativePath.cjs +1 -2
- package/lib/build-tests/getRelativePath.d.ts +1 -1
- package/lib/build-tests/getRelativePath.js +1 -2
- package/lib/build-tests/getTypescriptOutdir.cjs +1 -2
- package/lib/build-tests/getTypescriptOutdir.d.ts +1 -1
- package/lib/build-tests/getTypescriptOutdir.js +1 -2
- package/lib/build-tests/import.cjs +1 -2
- package/lib/build-tests/import.js +1 -2
- package/lib/build-tests/imports/create.cjs +1 -2
- package/lib/build-tests/imports/create.js +1 -2
- package/lib/build-tests/imports/helper.cjs +1 -2
- package/lib/build-tests/imports/helper.js +1 -2
- package/lib/build-tests/imports/index.js +1 -2
- package/lib/build-tests/index.cjs +1 -1
- package/lib/build-tests/index.js +1 -1
- package/lib/build-tests/pack.cjs +2 -3
- package/lib/build-tests/pack.d.ts +1 -1
- package/lib/build-tests/pack.js +2 -3
- package/lib/pack/config.cjs +103 -0
- package/lib/pack/config.cjs.map +1 -0
- package/lib/pack/config.d.ts +21 -0
- package/lib/pack/config.js +102 -0
- package/lib/pack/config.js.map +1 -0
- package/lib/pack/constants.cjs +45 -0
- package/lib/pack/constants.cjs.map +1 -0
- package/lib/pack/constants.d.ts +23 -0
- package/lib/pack/constants.js +40 -0
- package/lib/pack/constants.js.map +1 -0
- package/lib/pack/index.cjs +17 -0
- package/lib/pack/index.d.ts +6 -0
- package/lib/pack/index.js +6 -0
- package/lib/pack/input.cjs +19 -0
- package/lib/pack/input.cjs.map +1 -0
- package/lib/pack/input.d.ts +10 -0
- package/lib/pack/input.js +18 -0
- package/lib/pack/input.js.map +1 -0
- package/lib/pack/output.cjs +26 -0
- package/lib/pack/output.cjs.map +1 -0
- package/lib/pack/output.d.ts +13 -0
- package/lib/pack/output.js +25 -0
- package/lib/pack/output.js.map +1 -0
- package/lib/pack/plugins/circulars.cjs +39 -0
- package/lib/pack/plugins/circulars.cjs.map +1 -0
- package/lib/pack/plugins/circulars.d.ts +18 -0
- package/lib/pack/plugins/circulars.js +38 -0
- package/lib/pack/plugins/circulars.js.map +1 -0
- package/lib/pack/plugins/index.cjs +22 -0
- package/lib/pack/plugins/index.cjs.map +1 -0
- package/lib/pack/plugins/index.d.ts +25 -0
- package/lib/pack/plugins/index.js +21 -0
- package/lib/pack/plugins/index.js.map +1 -0
- package/lib/pack/project.cjs +32 -0
- package/lib/pack/project.cjs.map +1 -0
- package/lib/pack/project.d.ts +9 -0
- package/lib/pack/project.js +31 -0
- package/lib/pack/project.js.map +1 -0
- package/lib/pack/types.d.ts +46 -0
- package/lib/plugins/hmr.cjs +19 -5
- package/lib/plugins/hmr.cjs.map +1 -1
- package/lib/plugins/hmr.d.ts +14 -1
- package/lib/plugins/hmr.js +18 -4
- package/lib/plugins/hmr.js.map +1 -1
- package/lib/plugins/suppressWarnings.cjs +1 -2
- package/lib/plugins/suppressWarnings.js +1 -2
- package/lib/rolldown-config/config.cjs +3 -4
- package/lib/rolldown-config/config.cjs.map +1 -1
- package/lib/rolldown-config/config.js +3 -4
- package/lib/rolldown-config/config.js.map +1 -1
- package/lib/rolldown-config/constants.cjs +1 -2
- package/lib/rolldown-config/constants.js +1 -2
- package/lib/rolldown-config/helpers.cjs +1 -2
- package/lib/rolldown-config/helpers.js +1 -2
- package/lib/rolldown-config/index.cjs +1 -1
- package/lib/rolldown-config/index.js +1 -1
- package/lib/rolldown-config/input.cjs +1 -2
- package/lib/rolldown-config/input.js +1 -2
- package/lib/rolldown-config/output.cjs +1 -2
- package/lib/rolldown-config/output.js +1 -2
- package/lib/rolldown-config/plugins/circulars.cjs +1 -2
- package/lib/rolldown-config/plugins/circulars.js +1 -2
- package/lib/rolldown-config/plugins/clean.cjs +2 -3
- package/lib/rolldown-config/plugins/clean.js +2 -3
- package/lib/rolldown-config/plugins/externals.cjs +1 -2
- package/lib/rolldown-config/plugins/externals.js +1 -2
- package/lib/rolldown-config/plugins/index.cjs +1 -2
- package/lib/rolldown-config/plugins/index.js +1 -2
- package/lib/rolldown-config/plugins/typescript.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.config.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.config.js +1 -2
- package/lib/rolldown-config/plugins/typescript.fast.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.fast.js +1 -2
- package/lib/rolldown-config/plugins/typescript.js +1 -2
- package/lib/utils/array.cjs +1 -2
- package/lib/utils/array.js +1 -2
- package/lib/utils/bemedev/globals/types.d.ts +1 -0
- package/lib/utils/bemedev/globals/utils/_unknown.cjs +1 -2
- package/lib/utils/bemedev/globals/utils/_unknown.js +1 -2
- package/lib/utils/bemedev/globals/utils/expandFn.cjs +1 -2
- package/lib/utils/bemedev/globals/utils/expandFn.js +1 -2
- package/lib/utils/clamp.cjs +1 -2
- package/lib/utils/clamp.js +1 -2
- package/lib/utils/identity.cjs +1 -2
- package/lib/utils/identity.js +1 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/sleep.cjs +1 -2
- package/lib/utils/sleep.js +1 -2
- package/lib/utils/types.d.ts +1 -1
- package/lib/vitest-exclude/constants.cjs +1 -2
- package/lib/vitest-exclude/constants.js +1 -2
- package/lib/vitest-exclude/index.js +1 -2
- package/lib/vitest-exclude/vitest.cjs +2 -3
- package/lib/vitest-exclude/vitest.js +2 -3
- package/lib/vitest-exclude/vitest.utils.cjs +1 -2
- package/lib/vitest-exclude/vitest.utils.js +1 -2
- package/lib/vitest-extended/acceptation.cjs +1 -2
- package/lib/vitest-extended/acceptation.js +1 -2
- package/lib/vitest-extended/createTests.cjs +2 -3
- package/lib/vitest-extended/createTests.js +2 -3
- package/lib/vitest-extended/done.cjs +1 -2
- package/lib/vitest-extended/done.js +1 -2
- package/lib/vitest-extended/each/error.cjs +2 -3
- package/lib/vitest-extended/each/error.js +2 -3
- package/lib/vitest-extended/each/pass.cjs +2 -3
- package/lib/vitest-extended/each/pass.js +2 -3
- package/lib/vitest-extended/fakeWaiter.cjs +1 -2
- package/lib/vitest-extended/fakeWaiter.js +1 -2
- package/lib/vitest-extended/fixtures/coverage.cjs +1 -2
- package/lib/vitest-extended/fixtures/coverage.js +1 -2
- package/lib/vitest-extended/fixtures/partialCall.cjs +1 -2
- package/lib/vitest-extended/fixtures/partialCall.js +1 -2
- package/lib/vitest-extended/fixtures/toUpper.cjs +1 -2
- package/lib/vitest-extended/fixtures/toUpper.js +1 -2
- package/lib/vitest-extended/fixtures/vitest.cjs +1 -2
- package/lib/vitest-extended/fixtures/vitest.js +1 -2
- package/lib/vitest-extended/fixtures/zod.cjs +1 -2
- package/lib/vitest-extended/fixtures/zod.js +1 -2
- package/lib/vitest-extended/identity.cjs +1 -2
- package/lib/vitest-extended/identity.js +1 -2
- package/lib/vitest-extended/index.cjs +2 -2
- package/lib/vitest-extended/index.js +2 -2
- package/lib/vitest-extended/isDefined.cjs +1 -2
- package/lib/vitest-extended/isDefined.js +1 -2
- package/lib/vitest-extended/isFunction.cjs +1 -2
- package/lib/vitest-extended/isFunction.js +1 -2
- package/lib/vitest-extended/project.cjs +9 -7
- package/lib/vitest-extended/project.cjs.map +1 -1
- package/lib/vitest-extended/project.d.ts +2 -2
- package/lib/vitest-extended/project.js +10 -8
- package/lib/vitest-extended/project.js.map +1 -1
- package/lib/vitest-extended/toArray.cjs +1 -2
- package/lib/vitest-extended/toArray.js +1 -2
- package/lib/vitest-extended/toStringFlat.cjs +1 -2
- package/lib/vitest-extended/toStringFlat.js +1 -2
- package/package.json +68 -59
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toArrayVitest } from "../toArray.js";
|
|
2
1
|
import { identity } from "../identity.js";
|
|
2
|
+
import { toArrayVitest } from "../toArray.js";
|
|
3
3
|
import { expect, test } from "vitest";
|
|
4
|
-
|
|
4
|
+
// src/vitest-extended/each/error.ts
|
|
5
5
|
/**
|
|
6
6
|
* Runs error assertions for asynchronous test cases concurrently.
|
|
7
7
|
*/
|
|
@@ -26,7 +26,6 @@ const useErrorAsyncEachCases = (f, transform = identity, toError = () => void 0,
|
|
|
26
26
|
const useErrorAsyncEach = (f, transform, toError) => {
|
|
27
27
|
return (...cases) => useErrorAsyncEachCases(f, transform, toError, ...cases);
|
|
28
28
|
};
|
|
29
|
-
//#endregion
|
|
30
29
|
export { useErrorAsyncEach, useErrorAsyncEachCases };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=error.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vitest_extended_toArray = require("../toArray.cjs");
|
|
3
2
|
const require_vitest_extended_identity = require("../identity.cjs");
|
|
3
|
+
const require_vitest_extended_toArray = require("../toArray.cjs");
|
|
4
4
|
let vitest = require("vitest");
|
|
5
|
-
|
|
5
|
+
// src/vitest-extended/each/pass.ts
|
|
6
6
|
const useEachCases = (func, transform = require_vitest_extended_identity.identity, ...cases) => {
|
|
7
7
|
vitest.test.concurrent.each(require_vitest_extended_toArray.toArrayVitest(cases))("%s", (_, args, expected, test = require_vitest_extended_identity.defaultEquality) => {
|
|
8
8
|
return test(transform(func(...args)), expected);
|
|
@@ -35,7 +35,6 @@ const useEachAsyncCases = (f, transform = require_vitest_extended_identity.ident
|
|
|
35
35
|
const useEachAsync = (func, transform) => {
|
|
36
36
|
return (...cases) => useEachAsyncCases(func, transform, ...cases);
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
exports.useEach = useEach;
|
|
40
39
|
exports.useEachAsync = useEachAsync;
|
|
41
40
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toArrayVitest } from "../toArray.js";
|
|
2
1
|
import { defaultEquality, identity } from "../identity.js";
|
|
2
|
+
import { toArrayVitest } from "../toArray.js";
|
|
3
3
|
import { test } from "vitest";
|
|
4
|
-
|
|
4
|
+
// src/vitest-extended/each/pass.ts
|
|
5
5
|
const useEachCases = (func, transform = identity, ...cases) => {
|
|
6
6
|
test.concurrent.each(toArrayVitest(cases))("%s", (_, args, expected, test = defaultEquality) => {
|
|
7
7
|
return test(transform(func(...args)), expected);
|
|
@@ -34,7 +34,6 @@ const useEachAsyncCases = (f, transform = identity, ...cases) => {
|
|
|
34
34
|
const useEachAsync = (func, transform) => {
|
|
35
35
|
return (...cases) => useEachAsyncCases(func, transform, ...cases);
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { useEach, useEachAsync };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=pass.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_sleep = require("../utils/sleep.cjs");
|
|
3
|
-
|
|
3
|
+
// src/vitest-extended/fakeWaiter.ts
|
|
4
4
|
const buildInvite = (index = 0, ms = 0, times = 1) => `#${index} Wait for ${ms}ms times ${times}`;
|
|
5
5
|
/**
|
|
6
6
|
* Creates a timer-advancing waiter function that supports both fake timers and real delays.
|
|
@@ -30,7 +30,6 @@ createFakeWaiter.all = (vi) => {
|
|
|
30
30
|
return [invite, fn];
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
//#endregion
|
|
34
33
|
exports.createFakeWaiter = createFakeWaiter;
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=fakeWaiter.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sleep } from "../utils/sleep.js";
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fakeWaiter.ts
|
|
3
3
|
const buildInvite = (index = 0, ms = 0, times = 1) => `#${index} Wait for ${ms}ms times ${times}`;
|
|
4
4
|
/**
|
|
5
5
|
* Creates a timer-advancing waiter function that supports both fake timers and real delays.
|
|
@@ -29,7 +29,6 @@ createFakeWaiter.all = (vi) => {
|
|
|
29
29
|
return [invite, fn];
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { createFakeWaiter };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=fakeWaiter.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/coverage.ts
|
|
3
3
|
/**
|
|
4
4
|
* Test fixture constant.
|
|
5
5
|
*/
|
|
@@ -14,7 +14,6 @@ const noArgs = () => expected;
|
|
|
14
14
|
* Test fixture adding multiple numbers together.
|
|
15
15
|
*/
|
|
16
16
|
const addMany = (...numbers) => numbers.reduce((acc, value) => acc + value, 0);
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.addMany = addMany;
|
|
19
18
|
exports.expected = expected;
|
|
20
19
|
exports.noArgs = noArgs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/coverage.ts
|
|
2
2
|
/**
|
|
3
3
|
* Test fixture constant.
|
|
4
4
|
*/
|
|
@@ -13,7 +13,6 @@ const noArgs = () => expected;
|
|
|
13
13
|
* Test fixture adding multiple numbers together.
|
|
14
14
|
*/
|
|
15
15
|
const addMany = (...numbers) => numbers.reduce((acc, value) => acc + value, 0);
|
|
16
|
-
//#endregion
|
|
17
16
|
export { addMany, expected, noArgs };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=coverage.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/partialCall.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a partially applied function for a single object parameter function.
|
|
5
5
|
*
|
|
@@ -18,7 +18,6 @@ function partialCallO(f, headArgs) {
|
|
|
18
18
|
...headArgs
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
exports.partialCallO = partialCallO;
|
|
23
22
|
|
|
24
23
|
//# sourceMappingURL=partialCall.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/partialCall.ts
|
|
2
2
|
/**
|
|
3
3
|
* Creates a partially applied function for a single object parameter function.
|
|
4
4
|
*
|
|
@@ -17,7 +17,6 @@ function partialCallO(f, headArgs) {
|
|
|
17
17
|
...headArgs
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { partialCallO };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=partialCall.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/toUpper.ts
|
|
3
3
|
/**
|
|
4
4
|
* Converts a string to uppercase.
|
|
5
5
|
*
|
|
@@ -24,7 +24,6 @@ const _toUpper = (str) => {
|
|
|
24
24
|
const toUpper = (...strs) => {
|
|
25
25
|
return strs.map(_toUpper);
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
exports._toUpper = _toUpper;
|
|
29
28
|
exports.toUpper = toUpper;
|
|
30
29
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/toUpper.ts
|
|
2
2
|
/**
|
|
3
3
|
* Converts a string to uppercase.
|
|
4
4
|
*
|
|
@@ -23,7 +23,6 @@ const _toUpper = (str) => {
|
|
|
23
23
|
const toUpper = (...strs) => {
|
|
24
24
|
return strs.map(_toUpper);
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { _toUpper, toUpper };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=toUpper.js.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/vitest.ts
|
|
3
3
|
/**
|
|
4
4
|
* Flag indicating whether tests are executed within the VS Code Vitest extension.
|
|
5
5
|
*/
|
|
6
6
|
const IS_EXTENSION = process.env.VITEST_VSCODE === "true";
|
|
7
|
-
//#endregion
|
|
8
7
|
exports.IS_EXTENSION = IS_EXTENSION;
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=vitest.cjs.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/vitest.ts
|
|
2
2
|
/**
|
|
3
3
|
* Flag indicating whether tests are executed within the VS Code Vitest extension.
|
|
4
4
|
*/
|
|
5
5
|
const IS_EXTENSION = process.env.VITEST_VSCODE === "true";
|
|
6
|
-
//#endregion
|
|
7
6
|
export { IS_EXTENSION };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=vitest.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/zod.ts
|
|
3
3
|
/**
|
|
4
4
|
* Converts a Zod schema into a synchronous type-guard validation function.
|
|
5
5
|
*
|
|
@@ -36,7 +36,6 @@ const transformZodToFunctionAsync = (zod) => {
|
|
|
36
36
|
* Alias for {@linkcode transformZodToFunctionAsync}.
|
|
37
37
|
*/
|
|
38
38
|
const transformZTFAsync = transformZodToFunctionAsync;
|
|
39
|
-
//#endregion
|
|
40
39
|
exports.transformZTF = transformZTF;
|
|
41
40
|
exports.transformZTFAsync = transformZTFAsync;
|
|
42
41
|
exports.transformZodToFunction = transformZodToFunction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/zod.ts
|
|
2
2
|
/**
|
|
3
3
|
* Converts a Zod schema into a synchronous type-guard validation function.
|
|
4
4
|
*
|
|
@@ -35,7 +35,6 @@ const transformZodToFunctionAsync = (zod) => {
|
|
|
35
35
|
* Alias for {@linkcode transformZodToFunctionAsync}.
|
|
36
36
|
*/
|
|
37
37
|
const transformZTFAsync = transformZodToFunctionAsync;
|
|
38
|
-
//#endregion
|
|
39
38
|
export { transformZTF, transformZTFAsync, transformZodToFunction, transformZodToFunctionAsync };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=zod.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let vitest = require("vitest");
|
|
3
|
-
|
|
3
|
+
// src/vitest-extended/identity.ts
|
|
4
4
|
/**
|
|
5
5
|
* Identity function returning its argument unmodified.
|
|
6
6
|
*
|
|
@@ -24,7 +24,6 @@ const defaultEquality = (value, expected) => {
|
|
|
24
24
|
if (Array.isArray(value) && Array.isArray(expected)) return (0, vitest.expect)(value.sort()).toStrictEqual(expected.sort());
|
|
25
25
|
return (0, vitest.expect)(value).toStrictEqual(expected);
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.defaultEquality = defaultEquality;
|
|
29
28
|
exports.identity = identity;
|
|
30
29
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/identity.ts
|
|
3
3
|
/**
|
|
4
4
|
* Identity function returning its argument unmodified.
|
|
5
5
|
*
|
|
@@ -23,7 +23,6 @@ const defaultEquality = (value, expected) => {
|
|
|
23
23
|
if (Array.isArray(value) && Array.isArray(expected)) return expect(value.sort()).toStrictEqual(expected.sort());
|
|
24
24
|
return expect(value).toStrictEqual(expected);
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { defaultEquality, identity };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vitest_extended_project = require("./project.cjs");
|
|
3
2
|
const require_vitest_extended_acceptation = require("./acceptation.cjs");
|
|
3
|
+
const require_vitest_extended_createTests = require("./createTests.cjs");
|
|
4
4
|
const require_vitest_extended_each_error = require("./each/error.cjs");
|
|
5
5
|
const require_vitest_extended_each_pass = require("./each/pass.cjs");
|
|
6
|
-
const require_vitest_extended_createTests = require("./createTests.cjs");
|
|
7
6
|
const require_vitest_extended_done = require("./done.cjs");
|
|
8
7
|
require("./each/index.cjs");
|
|
9
8
|
const require_vitest_extended_fakeWaiter = require("./fakeWaiter.cjs");
|
|
9
|
+
const require_vitest_extended_project = require("./project.cjs");
|
|
10
10
|
exports.createFakeWaiter = require_vitest_extended_fakeWaiter.createFakeWaiter;
|
|
11
11
|
exports.createTests = require_vitest_extended_createTests.createTests;
|
|
12
12
|
exports.defineProject = require_vitest_extended_project.defineProject;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineProject } from "./project.js";
|
|
2
1
|
import { useTFA, useTestFunctionAcceptation } from "./acceptation.js";
|
|
2
|
+
import { createTests } from "./createTests.js";
|
|
3
3
|
import { useErrorAsyncEach, useErrorAsyncEachCases } from "./each/error.js";
|
|
4
4
|
import { useEach, useEachAsync } from "./each/pass.js";
|
|
5
|
-
import { createTests } from "./createTests.js";
|
|
6
5
|
import { doneTest } from "./done.js";
|
|
7
6
|
import "./each/index.js";
|
|
8
7
|
import { createFakeWaiter } from "./fakeWaiter.js";
|
|
8
|
+
import { defineProject } from "./project.js";
|
|
9
9
|
export { createFakeWaiter, createTests, defineProject, doneTest, useEach, useEachAsync, useErrorAsyncEach, useErrorAsyncEachCases, useTFA, useTestFunctionAcceptation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/isDefined.ts
|
|
3
3
|
/**
|
|
4
4
|
* Type guard to check if a value is defined (not `null` and not `undefined`).
|
|
5
5
|
*
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
12
12
|
const isDefined = (value) => {
|
|
13
13
|
return value !== void 0 && value !== null;
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
exports.isDefined = isDefined;
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=isDefined.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/isDefined.ts
|
|
2
2
|
/**
|
|
3
3
|
* Type guard to check if a value is defined (not `null` and not `undefined`).
|
|
4
4
|
*
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
const isDefined = (value) => {
|
|
12
12
|
return value !== void 0 && value !== null;
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { isDefined };
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=isDefined.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/isFunction.ts
|
|
3
3
|
/**
|
|
4
4
|
* Determines whether the given value is a function.
|
|
5
5
|
*
|
|
@@ -13,7 +13,6 @@ function isFunction(arg) {
|
|
|
13
13
|
const isArrow = Object.prototype.toString.call(arg) === "[object Function]";
|
|
14
14
|
return !!arg && (isType || isInstance || isArrow);
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
exports.isFunction = isFunction;
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=isFunction.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/isFunction.ts
|
|
2
2
|
/**
|
|
3
3
|
* Determines whether the given value is a function.
|
|
4
4
|
*
|
|
@@ -12,7 +12,6 @@ function isFunction(arg) {
|
|
|
12
12
|
const isArrow = Object.prototype.toString.call(arg) === "[object Function]";
|
|
13
13
|
return !!arg && (isType || isInstance || isArrow);
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { isFunction };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=isFunction.js.map
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let vitest_config = require("vitest/config");
|
|
3
|
-
|
|
3
|
+
// src/vitest-extended/project.ts
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to define a Vitest project configuration with defaults.
|
|
6
6
|
*
|
|
7
7
|
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
8
8
|
*
|
|
9
|
-
* @returns Configured Vitest project configuration.
|
|
9
|
+
* @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.
|
|
10
10
|
*/
|
|
11
11
|
const defineProject = (conf) => {
|
|
12
12
|
const _env = conf.test?.env ?? {};
|
|
13
|
-
return (0, vitest_config.
|
|
14
|
-
resolve: { tsconfigPaths: true },
|
|
13
|
+
return (0, vitest_config.defineProject)({
|
|
15
14
|
...conf,
|
|
15
|
+
resolve: {
|
|
16
|
+
...conf.resolve,
|
|
17
|
+
tsconfigPaths: true
|
|
18
|
+
},
|
|
16
19
|
test: {
|
|
20
|
+
...conf.test,
|
|
17
21
|
globals: true,
|
|
18
22
|
logHeapUsage: false,
|
|
19
23
|
env: {
|
|
20
24
|
NODE_ENV: "test",
|
|
21
25
|
..._env
|
|
22
|
-
}
|
|
23
|
-
...conf.test
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
});
|
|
26
29
|
};
|
|
27
|
-
//#endregion
|
|
28
30
|
exports.defineProject = defineProject;
|
|
29
31
|
|
|
30
32
|
//# sourceMappingURL=project.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.cjs","names":["
|
|
1
|
+
{"version":3,"file":"project.cjs","names":["project"],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineProject as project, type UserWorkspaceConfig } from 'vitest/config';\n\n/**\n * Helper function to define a Vitest project configuration with defaults.\n *\n * @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.\n *\n * @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.\n */\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return project({\n ...conf,\n resolve: { ...conf.resolve, tsconfigPaths: true },\n\n test: {\n ...conf.test,\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n },\n });\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,iBAAiB,SAA8B;CAC1D,MAAM,OAAO,KAAK,MAAM,OAAO,CAAC;CAEhC,QAAA,GAAOA,cAAAA,cAAAA,CAAQ;EACb,GAAG;EACH,SAAS;GAAE,GAAG,KAAK;GAAS,eAAe;EAAK;EAEhD,MAAM;GACJ,GAAG,KAAK;GACR,SAAS;GACT,cAAc;GACd,KAAK;IAAE,UAAU;IAAQ,GAAG;GAAK;EACnC;CACF,CAAC;AACH"}
|
|
@@ -4,6 +4,6 @@ import { type UserWorkspaceConfig } from 'vitest/config';
|
|
|
4
4
|
*
|
|
5
5
|
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
6
6
|
*
|
|
7
|
-
* @returns Configured Vitest project configuration.
|
|
7
|
+
* @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.
|
|
8
8
|
*/
|
|
9
|
-
export declare const defineProject: (conf: UserWorkspaceConfig) =>
|
|
9
|
+
export declare const defineProject: (conf: UserWorkspaceConfig) => UserWorkspaceConfig;
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineProject as defineProject$1 } from "vitest/config";
|
|
2
|
+
// src/vitest-extended/project.ts
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to define a Vitest project configuration with defaults.
|
|
5
5
|
*
|
|
6
6
|
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
7
7
|
*
|
|
8
|
-
* @returns Configured Vitest project configuration.
|
|
8
|
+
* @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.
|
|
9
9
|
*/
|
|
10
10
|
const defineProject = (conf) => {
|
|
11
11
|
const _env = conf.test?.env ?? {};
|
|
12
|
-
return
|
|
13
|
-
resolve: { tsconfigPaths: true },
|
|
12
|
+
return defineProject$1({
|
|
14
13
|
...conf,
|
|
14
|
+
resolve: {
|
|
15
|
+
...conf.resolve,
|
|
16
|
+
tsconfigPaths: true
|
|
17
|
+
},
|
|
15
18
|
test: {
|
|
19
|
+
...conf.test,
|
|
16
20
|
globals: true,
|
|
17
21
|
logHeapUsage: false,
|
|
18
22
|
env: {
|
|
19
23
|
NODE_ENV: "test",
|
|
20
24
|
..._env
|
|
21
|
-
}
|
|
22
|
-
...conf.test
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
});
|
|
25
28
|
};
|
|
26
|
-
//#endregion
|
|
27
29
|
export { defineProject };
|
|
28
30
|
|
|
29
31
|
//# sourceMappingURL=project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","names":[],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"project.js","names":["project"],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineProject as project, type UserWorkspaceConfig } from 'vitest/config';\n\n/**\n * Helper function to define a Vitest project configuration with defaults.\n *\n * @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.\n *\n * @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.\n */\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return project({\n ...conf,\n resolve: { ...conf.resolve, tsconfigPaths: true },\n\n test: {\n ...conf.test,\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n },\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,iBAAiB,SAA8B;CAC1D,MAAM,OAAO,KAAK,MAAM,OAAO,CAAC;CAEhC,OAAOA,gBAAQ;EACb,GAAG;EACH,SAAS;GAAE,GAAG,KAAK;GAAS,eAAe;EAAK;EAEhD,MAAM;GACJ,GAAG,KAAK;GACR,SAAS;GACT,cAAc;GACd,KAAK;IAAE,UAAU;IAAQ,GAAG;GAAK;EACnC;CACF,CAAC;AACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_vitest_extended_isDefined = require("./isDefined.cjs");
|
|
3
|
-
|
|
3
|
+
// src/vitest-extended/toArray.ts
|
|
4
4
|
/**
|
|
5
5
|
* Transforms test case arguments into the tuple format expected by Vitest each runners.
|
|
6
6
|
*/
|
|
@@ -34,7 +34,6 @@ const toArray = (obj) => {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
toArray.generic = (obj) => toArray(obj);
|
|
37
|
-
//#endregion
|
|
38
37
|
exports.toArray = toArray;
|
|
39
38
|
exports.toArrayVitest = toArrayVitest;
|
|
40
39
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isDefined } from "./isDefined.js";
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/toArray.ts
|
|
3
3
|
/**
|
|
4
4
|
* Transforms test case arguments into the tuple format expected by Vitest each runners.
|
|
5
5
|
*/
|
|
@@ -33,7 +33,6 @@ const toArray = (obj) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
toArray.generic = (obj) => toArray(obj);
|
|
36
|
-
//#endregion
|
|
37
36
|
export { toArray, toArrayVitest };
|
|
38
37
|
|
|
39
38
|
//# sourceMappingURL=toArray.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/toStringFlat.ts
|
|
3
3
|
const log10 = (value) => {
|
|
4
4
|
return Math.floor(Math.log10(value));
|
|
5
5
|
};
|
|
@@ -20,7 +20,6 @@ const toStringFlat = (_value, _len) => {
|
|
|
20
20
|
out += _value;
|
|
21
21
|
return out;
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
exports.toStringFlat = toStringFlat;
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=toStringFlat.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/toStringFlat.ts
|
|
2
2
|
const log10 = (value) => {
|
|
3
3
|
return Math.floor(Math.log10(value));
|
|
4
4
|
};
|
|
@@ -19,7 +19,6 @@ const toStringFlat = (_value, _len) => {
|
|
|
19
19
|
out += _value;
|
|
20
20
|
return out;
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { toStringFlat };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=toStringFlat.js.map
|