@bemedev/dev-utils 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/lib/_virtual/_rolldown/runtime.cjs +1 -1
- package/lib/build-tests/addTarball.cjs +5 -1
- package/lib/build-tests/addTarball.cjs.map +1 -1
- package/lib/build-tests/addTarball.d.ts +3 -0
- package/lib/build-tests/addTarball.js +5 -1
- package/lib/build-tests/addTarball.js.map +1 -1
- package/lib/build-tests/buildPackageJson.cjs +17 -9
- package/lib/build-tests/buildPackageJson.cjs.map +1 -1
- package/lib/build-tests/buildPackageJson.d.ts +5 -0
- package/lib/build-tests/buildPackageJson.js +17 -9
- package/lib/build-tests/buildPackageJson.js.map +1 -1
- package/lib/build-tests/cleanup.cjs +3 -0
- package/lib/build-tests/cleanup.cjs.map +1 -1
- package/lib/build-tests/cleanup.d.ts +3 -0
- package/lib/build-tests/cleanup.js +3 -0
- package/lib/build-tests/cleanup.js.map +1 -1
- package/lib/build-tests/cli/cli.cjs +6 -0
- package/lib/build-tests/cli/cli.cjs.map +1 -1
- package/lib/build-tests/cli/cli.d.ts +6 -0
- package/lib/build-tests/cli/cli.js +6 -0
- package/lib/build-tests/cli/cli.js.map +1 -1
- package/lib/build-tests/cli/index.cjs.map +1 -1
- package/lib/build-tests/cli/post.cjs +3 -0
- package/lib/build-tests/cli/post.cjs.map +1 -1
- package/lib/build-tests/cli/post.d.ts +3 -0
- package/lib/build-tests/cli/post.js +3 -0
- package/lib/build-tests/cli/post.js.map +1 -1
- package/lib/build-tests/cli/pre.cjs +3 -0
- package/lib/build-tests/cli/pre.cjs.map +1 -1
- package/lib/build-tests/cli/pre.d.ts +3 -0
- package/lib/build-tests/cli/pre.js +3 -0
- package/lib/build-tests/cli/pre.js.map +1 -1
- package/lib/build-tests/cli/test.cjs +3 -0
- 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 +3 -0
- package/lib/build-tests/cli/test.js.map +1 -1
- package/lib/build-tests/constants.cjs +42 -0
- package/lib/build-tests/constants.cjs.map +1 -1
- package/lib/build-tests/constants.d.ts +42 -0
- package/lib/build-tests/constants.js +42 -0
- package/lib/build-tests/constants.js.map +1 -1
- package/lib/build-tests/getRelativePath.cjs +7 -0
- package/lib/build-tests/getRelativePath.cjs.map +1 -1
- package/lib/build-tests/getRelativePath.d.ts +7 -0
- package/lib/build-tests/getRelativePath.js +7 -0
- package/lib/build-tests/getRelativePath.js.map +1 -1
- package/lib/build-tests/getTypescriptOutdir.cjs +5 -0
- package/lib/build-tests/getTypescriptOutdir.cjs.map +1 -1
- package/lib/build-tests/getTypescriptOutdir.d.ts +5 -0
- package/lib/build-tests/getTypescriptOutdir.js +5 -0
- package/lib/build-tests/getTypescriptOutdir.js.map +1 -1
- package/lib/build-tests/import.cjs +9 -0
- package/lib/build-tests/import.cjs.map +1 -1
- package/lib/build-tests/import.d.ts +9 -0
- package/lib/build-tests/import.js +9 -0
- package/lib/build-tests/import.js.map +1 -1
- package/lib/build-tests/imports/create.cjs +7 -0
- package/lib/build-tests/imports/create.cjs.map +1 -1
- package/lib/build-tests/imports/create.d.ts +13 -0
- package/lib/build-tests/imports/create.js +7 -0
- package/lib/build-tests/imports/create.js.map +1 -1
- package/lib/build-tests/imports/helper.cjs +9 -0
- package/lib/build-tests/imports/helper.cjs.map +1 -1
- package/lib/build-tests/imports/helper.d.ts +12 -0
- package/lib/build-tests/imports/helper.js +9 -0
- package/lib/build-tests/imports/helper.js.map +1 -1
- package/lib/build-tests/pack.cjs +7 -1
- package/lib/build-tests/pack.cjs.map +1 -1
- package/lib/build-tests/pack.d.ts +5 -0
- package/lib/build-tests/pack.js +7 -1
- package/lib/build-tests/pack.js.map +1 -1
- package/lib/plugins/index.cjs +3 -0
- package/lib/plugins/index.d.ts +1 -0
- package/lib/plugins/index.js +2 -0
- package/lib/plugins/suppressWarnings.cjs +37 -0
- package/lib/plugins/suppressWarnings.cjs.map +1 -0
- package/lib/plugins/suppressWarnings.d.ts +12 -0
- package/lib/plugins/suppressWarnings.js +36 -0
- package/lib/plugins/suppressWarnings.js.map +1 -0
- package/lib/rolldown-config/config.cjs +13 -5
- package/lib/rolldown-config/config.cjs.map +1 -1
- package/lib/rolldown-config/config.d.ts +7 -0
- package/lib/rolldown-config/config.js +13 -5
- package/lib/rolldown-config/config.js.map +1 -1
- package/lib/rolldown-config/constants.cjs +15 -0
- package/lib/rolldown-config/constants.cjs.map +1 -1
- package/lib/rolldown-config/constants.d.ts +15 -0
- package/lib/rolldown-config/constants.js +15 -0
- package/lib/rolldown-config/constants.js.map +1 -1
- package/lib/rolldown-config/helpers.cjs +16 -1
- package/lib/rolldown-config/helpers.cjs.map +1 -1
- package/lib/rolldown-config/helpers.d.ts +14 -0
- package/lib/rolldown-config/helpers.js +16 -1
- package/lib/rolldown-config/helpers.js.map +1 -1
- package/lib/rolldown-config/input.cjs +8 -0
- package/lib/rolldown-config/input.cjs.map +1 -1
- package/lib/rolldown-config/input.d.ts +8 -0
- package/lib/rolldown-config/input.js +8 -0
- package/lib/rolldown-config/input.js.map +1 -1
- package/lib/rolldown-config/output.cjs +8 -0
- package/lib/rolldown-config/output.cjs.map +1 -1
- package/lib/rolldown-config/output.d.ts +8 -0
- package/lib/rolldown-config/output.js +8 -0
- package/lib/rolldown-config/output.js.map +1 -1
- package/lib/rolldown-config/plugins/circulars.cjs +4 -4
- package/lib/rolldown-config/plugins/circulars.cjs.map +1 -1
- package/lib/rolldown-config/plugins/circulars.d.ts +7 -4
- package/lib/rolldown-config/plugins/circulars.js +4 -4
- package/lib/rolldown-config/plugins/circulars.js.map +1 -1
- package/lib/rolldown-config/plugins/clean.cjs +10 -1
- package/lib/rolldown-config/plugins/clean.cjs.map +1 -1
- package/lib/rolldown-config/plugins/clean.d.ts +10 -0
- package/lib/rolldown-config/plugins/clean.js +10 -1
- package/lib/rolldown-config/plugins/clean.js.map +1 -1
- package/lib/rolldown-config/plugins/externals.cjs +4 -3
- package/lib/rolldown-config/plugins/externals.cjs.map +1 -1
- package/lib/rolldown-config/plugins/externals.d.ts +7 -3
- package/lib/rolldown-config/plugins/externals.js +4 -3
- package/lib/rolldown-config/plugins/externals.js.map +1 -1
- package/lib/rolldown-config/plugins/index.cjs +6 -0
- package/lib/rolldown-config/plugins/index.cjs.map +1 -1
- package/lib/rolldown-config/plugins/index.d.ts +6 -0
- package/lib/rolldown-config/plugins/index.js +6 -0
- package/lib/rolldown-config/plugins/index.js.map +1 -1
- package/lib/rolldown-config/plugins/typescript.cjs +7 -0
- package/lib/rolldown-config/plugins/typescript.cjs.map +1 -1
- package/lib/rolldown-config/plugins/typescript.config.cjs +15 -0
- package/lib/rolldown-config/plugins/typescript.config.cjs.map +1 -1
- package/lib/rolldown-config/plugins/typescript.config.d.ts +15 -0
- package/lib/rolldown-config/plugins/typescript.config.js +15 -0
- package/lib/rolldown-config/plugins/typescript.config.js.map +1 -1
- package/lib/rolldown-config/plugins/typescript.d.ts +10 -0
- package/lib/rolldown-config/plugins/typescript.fast.cjs +9 -1
- package/lib/rolldown-config/plugins/typescript.fast.cjs.map +1 -1
- package/lib/rolldown-config/plugins/typescript.fast.d.ts +10 -0
- package/lib/rolldown-config/plugins/typescript.fast.js +9 -1
- package/lib/rolldown-config/plugins/typescript.fast.js.map +1 -1
- package/lib/rolldown-config/plugins/typescript.js +7 -0
- package/lib/rolldown-config/plugins/typescript.js.map +1 -1
- package/lib/rolldown-config/types.d.ts +18 -0
- package/lib/utils/array.cjs +7 -0
- package/lib/utils/array.cjs.map +1 -1
- package/lib/utils/array.d.ts +8 -0
- package/lib/utils/array.js +7 -0
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/bemedev/globals/types.d.ts +20 -0
- package/lib/utils/bemedev/globals/utils/expandFn.cjs +11 -0
- package/lib/utils/bemedev/globals/utils/expandFn.cjs.map +1 -1
- package/lib/utils/bemedev/globals/utils/expandFn.d.ts +11 -0
- package/lib/utils/bemedev/globals/utils/expandFn.js +11 -0
- package/lib/utils/bemedev/globals/utils/expandFn.js.map +1 -1
- package/lib/utils/identity.cjs +9 -0
- package/lib/utils/identity.cjs.map +1 -1
- package/lib/utils/identity.d.ts +9 -0
- package/lib/utils/identity.js +9 -0
- package/lib/utils/identity.js.map +1 -1
- package/lib/utils/sleep.cjs +7 -0
- package/lib/utils/sleep.cjs.map +1 -1
- package/lib/utils/sleep.d.ts +7 -0
- package/lib/utils/sleep.js +7 -0
- package/lib/utils/sleep.js.map +1 -1
- package/lib/utils/types.d.ts +9 -0
- package/lib/vitest-exclude/constants.cjs +3 -0
- package/lib/vitest-exclude/constants.cjs.map +1 -1
- package/lib/vitest-exclude/constants.d.ts +3 -0
- package/lib/vitest-exclude/constants.js +3 -0
- package/lib/vitest-exclude/constants.js.map +1 -1
- package/lib/vitest-exclude/types.d.ts +11 -0
- package/lib/vitest-exclude/vitest.cjs +25 -12
- package/lib/vitest-exclude/vitest.cjs.map +1 -1
- package/lib/vitest-exclude/vitest.d.ts +9 -8
- package/lib/vitest-exclude/vitest.js +25 -12
- package/lib/vitest-exclude/vitest.js.map +1 -1
- package/lib/vitest-exclude/vitest.utils.cjs +30 -0
- package/lib/vitest-exclude/vitest.utils.cjs.map +1 -1
- package/lib/vitest-exclude/vitest.utils.d.ts +30 -0
- package/lib/vitest-exclude/vitest.utils.js +30 -0
- package/lib/vitest-exclude/vitest.utils.js.map +1 -1
- package/lib/vitest-extended/acceptation.cjs +11 -2
- package/lib/vitest-extended/acceptation.cjs.map +1 -1
- package/lib/vitest-extended/acceptation.d.ts +9 -1
- package/lib/vitest-extended/acceptation.js +11 -2
- package/lib/vitest-extended/acceptation.js.map +1 -1
- package/lib/vitest-extended/createTests.cjs +34 -27
- package/lib/vitest-extended/createTests.cjs.map +1 -1
- package/lib/vitest-extended/createTests.d.ts +20 -37
- package/lib/vitest-extended/createTests.js +34 -27
- package/lib/vitest-extended/createTests.js.map +1 -1
- package/lib/vitest-extended/createTests.types.d.ts +13 -2
- package/lib/vitest-extended/done.cjs +18 -15
- package/lib/vitest-extended/done.cjs.map +1 -1
- package/lib/vitest-extended/done.d.ts +6 -5
- package/lib/vitest-extended/done.js +18 -15
- package/lib/vitest-extended/done.js.map +1 -1
- package/lib/vitest-extended/each/error.cjs +12 -0
- package/lib/vitest-extended/each/error.cjs.map +1 -1
- package/lib/vitest-extended/each/error.d.ts +12 -0
- package/lib/vitest-extended/each/error.js +12 -0
- package/lib/vitest-extended/each/error.js.map +1 -1
- package/lib/vitest-extended/each/error.types.d.ts +17 -0
- package/lib/vitest-extended/each/pass.cjs +9 -20
- package/lib/vitest-extended/each/pass.cjs.map +1 -1
- package/lib/vitest-extended/each/pass.d.ts +9 -20
- package/lib/vitest-extended/each/pass.js +9 -20
- package/lib/vitest-extended/each/pass.js.map +1 -1
- package/lib/vitest-extended/each/pass.types.d.ts +24 -0
- package/lib/vitest-extended/fakeWaiter.cjs +7 -0
- package/lib/vitest-extended/fakeWaiter.cjs.map +1 -1
- package/lib/vitest-extended/fakeWaiter.d.ts +32 -0
- package/lib/vitest-extended/fakeWaiter.js +7 -0
- package/lib/vitest-extended/fakeWaiter.js.map +1 -1
- package/lib/vitest-extended/fixtures/coverage.cjs +11 -0
- package/lib/vitest-extended/fixtures/coverage.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/coverage.js +11 -0
- package/lib/vitest-extended/fixtures/coverage.js.map +1 -1
- package/lib/vitest-extended/fixtures/partialCall.cjs +9 -4
- package/lib/vitest-extended/fixtures/partialCall.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/partialCall.js +9 -4
- package/lib/vitest-extended/fixtures/partialCall.js.map +1 -1
- package/lib/vitest-extended/fixtures/toUpper.cjs +18 -0
- package/lib/vitest-extended/fixtures/toUpper.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/toUpper.js +18 -0
- package/lib/vitest-extended/fixtures/toUpper.js.map +1 -1
- package/lib/vitest-extended/fixtures/vitest.cjs +3 -0
- package/lib/vitest-extended/fixtures/vitest.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/vitest.js +3 -0
- package/lib/vitest-extended/fixtures/vitest.js.map +1 -1
- package/lib/vitest-extended/fixtures/zod.cjs +22 -0
- package/lib/vitest-extended/fixtures/zod.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/zod.js +22 -0
- package/lib/vitest-extended/fixtures/zod.js.map +1 -1
- package/lib/vitest-extended/identity.cjs +18 -0
- package/lib/vitest-extended/identity.cjs.map +1 -1
- package/lib/vitest-extended/identity.d.ts +18 -0
- package/lib/vitest-extended/identity.js +18 -0
- package/lib/vitest-extended/identity.js.map +1 -1
- package/lib/vitest-extended/isDefined.cjs +9 -0
- package/lib/vitest-extended/isDefined.cjs.map +1 -1
- package/lib/vitest-extended/isDefined.d.ts +9 -0
- package/lib/vitest-extended/isDefined.js +9 -0
- package/lib/vitest-extended/isDefined.js.map +1 -1
- package/lib/vitest-extended/isFunction.cjs +7 -0
- package/lib/vitest-extended/isFunction.cjs.map +1 -1
- package/lib/vitest-extended/isFunction.d.ts +7 -0
- package/lib/vitest-extended/isFunction.js +7 -0
- package/lib/vitest-extended/isFunction.js.map +1 -1
- package/lib/vitest-extended/project.cjs +7 -0
- package/lib/vitest-extended/project.cjs.map +1 -1
- package/lib/vitest-extended/project.d.ts +7 -0
- package/lib/vitest-extended/project.js +7 -0
- package/lib/vitest-extended/project.js.map +1 -1
- package/lib/vitest-extended/toArray.cjs +6 -0
- package/lib/vitest-extended/toArray.cjs.map +1 -1
- package/lib/vitest-extended/toArray.d.ts +6 -0
- package/lib/vitest-extended/toArray.js +6 -0
- package/lib/vitest-extended/toArray.js.map +1 -1
- package/lib/vitest-extended/toStringFlat.cjs +8 -0
- package/lib/vitest-extended/toStringFlat.cjs.map +1 -1
- package/lib/vitest-extended/toStringFlat.d.ts +8 -0
- package/lib/vitest-extended/toStringFlat.js +8 -0
- package/lib/vitest-extended/toStringFlat.js.map +1 -1
- package/lib/vitest-extended/types.d.ts +64 -0
- package/package.json +14 -9
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/vitest-extended/fixtures/partialCall.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Creates a partially applied function for a single object parameter function.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
6
|
+
* @template | {@linkcode object} `T` - Partial argument shape.
|
|
7
|
+
* @template `U` - Full argument shape extending `T`.
|
|
8
|
+
* @template `R` - Return type.
|
|
9
|
+
*
|
|
10
|
+
* @param f - Target function.
|
|
11
|
+
* @param headArgs - Initial partial argument values.
|
|
12
|
+
*
|
|
13
|
+
* @returns Function accepting remaining arguments.
|
|
9
14
|
*/
|
|
10
15
|
function partialCallO(f, headArgs) {
|
|
11
16
|
return (remainArgs) => f({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partialCall.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/partialCall.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"partialCall.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/partialCall.ts"],"sourcesContent":["/**\n * Creates a partially applied function for a single object parameter function.\n *\n * @template | {@linkcode object} `T` - Partial argument shape.\n * @template `U` - Full argument shape extending `T`.\n * @template `R` - Return type.\n *\n * @param f - Target function.\n * @param headArgs - Initial partial argument values.\n *\n * @returns Function accepting remaining arguments.\n */\nexport function partialCallO<T extends object, U extends T, R>(\n f: (arg: U) => R,\n headArgs?: T,\n) {\n return (remainArgs: Omit<U, keyof T>) =>\n f({ ...remainArgs, ...headArgs } as U);\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAgB,aACd,GACA,UACA;CACA,QAAQ,eACN,EAAE;EAAE,GAAG;EAAY,GAAG;CAAS,CAAM;AACzC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
//#region src/vitest-extended/fixtures/partialCall.ts
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Creates a partially applied function for a single object parameter function.
|
|
4
4
|
*
|
|
5
|
-
* @
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
5
|
+
* @template | {@linkcode object} `T` - Partial argument shape.
|
|
6
|
+
* @template `U` - Full argument shape extending `T`.
|
|
7
|
+
* @template `R` - Return type.
|
|
8
|
+
*
|
|
9
|
+
* @param f - Target function.
|
|
10
|
+
* @param headArgs - Initial partial argument values.
|
|
11
|
+
*
|
|
12
|
+
* @returns Function accepting remaining arguments.
|
|
8
13
|
*/
|
|
9
14
|
function partialCallO(f, headArgs) {
|
|
10
15
|
return (remainArgs) => f({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partialCall.js","names":[],"sources":["../../../src/vitest-extended/fixtures/partialCall.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"partialCall.js","names":[],"sources":["../../../src/vitest-extended/fixtures/partialCall.ts"],"sourcesContent":["/**\n * Creates a partially applied function for a single object parameter function.\n *\n * @template | {@linkcode object} `T` - Partial argument shape.\n * @template `U` - Full argument shape extending `T`.\n * @template `R` - Return type.\n *\n * @param f - Target function.\n * @param headArgs - Initial partial argument values.\n *\n * @returns Function accepting remaining arguments.\n */\nexport function partialCallO<T extends object, U extends T, R>(\n f: (arg: U) => R,\n headArgs?: T,\n) {\n return (remainArgs: Omit<U, keyof T>) =>\n f({ ...remainArgs, ...headArgs } as U);\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAgB,aACd,GACA,UACA;CACA,QAAQ,eACN,EAAE;EAAE,GAAG;EAAY,GAAG;CAAS,CAAM;AACzC"}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/vitest-extended/fixtures/toUpper.ts
|
|
3
|
+
/**
|
|
4
|
+
* Converts a string to uppercase.
|
|
5
|
+
*
|
|
6
|
+
* @template `S` - String type.
|
|
7
|
+
*
|
|
8
|
+
* @param str - Input string.
|
|
9
|
+
*
|
|
10
|
+
* @returns Uppercase string of type `Uppercase<S>`.
|
|
11
|
+
*/
|
|
3
12
|
const _toUpper = (str) => {
|
|
4
13
|
return str.toUpperCase();
|
|
5
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Converts an array of strings to uppercase.
|
|
17
|
+
*
|
|
18
|
+
* @template `S` - String array type.
|
|
19
|
+
*
|
|
20
|
+
* @param strs - Array of strings.
|
|
21
|
+
*
|
|
22
|
+
* @returns Array of uppercase strings.
|
|
23
|
+
*/
|
|
6
24
|
const toUpper = (...strs) => {
|
|
7
25
|
return strs.map(_toUpper);
|
|
8
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toUpper.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/toUpper.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"toUpper.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/toUpper.ts"],"sourcesContent":["/**\n * Converts a string to uppercase.\n *\n * @template `S` - String type.\n *\n * @param str - Input string.\n *\n * @returns Uppercase string of type `Uppercase<S>`.\n */\nexport const _toUpper = <S extends string>(str: S) => {\n const out = str.toUpperCase();\n return out as Uppercase<S>;\n};\n\n/**\n * Converts an array of strings to uppercase.\n *\n * @template `S` - String array type.\n *\n * @param strs - Array of strings.\n *\n * @returns Array of uppercase strings.\n */\nexport const toUpper = <S extends string[]>(...strs: S) => {\n return strs.map(_toUpper);\n};\n"],"mappings":";;;;;;;;;;;AASA,MAAa,YAA8B,QAAW;CAEpD,OADY,IAAI,YACP;AACX;;;;;;;;;;AAWA,MAAa,WAA+B,GAAG,SAAY;CACzD,OAAO,KAAK,IAAI,QAAQ;AAC1B"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
//#region src/vitest-extended/fixtures/toUpper.ts
|
|
2
|
+
/**
|
|
3
|
+
* Converts a string to uppercase.
|
|
4
|
+
*
|
|
5
|
+
* @template `S` - String type.
|
|
6
|
+
*
|
|
7
|
+
* @param str - Input string.
|
|
8
|
+
*
|
|
9
|
+
* @returns Uppercase string of type `Uppercase<S>`.
|
|
10
|
+
*/
|
|
2
11
|
const _toUpper = (str) => {
|
|
3
12
|
return str.toUpperCase();
|
|
4
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Converts an array of strings to uppercase.
|
|
16
|
+
*
|
|
17
|
+
* @template `S` - String array type.
|
|
18
|
+
*
|
|
19
|
+
* @param strs - Array of strings.
|
|
20
|
+
*
|
|
21
|
+
* @returns Array of uppercase strings.
|
|
22
|
+
*/
|
|
5
23
|
const toUpper = (...strs) => {
|
|
6
24
|
return strs.map(_toUpper);
|
|
7
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toUpper.js","names":[],"sources":["../../../src/vitest-extended/fixtures/toUpper.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"toUpper.js","names":[],"sources":["../../../src/vitest-extended/fixtures/toUpper.ts"],"sourcesContent":["/**\n * Converts a string to uppercase.\n *\n * @template `S` - String type.\n *\n * @param str - Input string.\n *\n * @returns Uppercase string of type `Uppercase<S>`.\n */\nexport const _toUpper = <S extends string>(str: S) => {\n const out = str.toUpperCase();\n return out as Uppercase<S>;\n};\n\n/**\n * Converts an array of strings to uppercase.\n *\n * @template `S` - String array type.\n *\n * @param strs - Array of strings.\n *\n * @returns Array of uppercase strings.\n */\nexport const toUpper = <S extends string[]>(...strs: S) => {\n return strs.map(_toUpper);\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,YAA8B,QAAW;CAEpD,OADY,IAAI,YACP;AACX;;;;;;;;;;AAWA,MAAa,WAA+B,GAAG,SAAY;CACzD,OAAO,KAAK,IAAI,QAAQ;AAC1B"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/vitest-extended/fixtures/vitest.ts
|
|
3
|
+
/**
|
|
4
|
+
* Flag indicating whether tests are executed within the VS Code Vitest extension.
|
|
5
|
+
*/
|
|
3
6
|
const IS_EXTENSION = process.env.VITEST_VSCODE === "true";
|
|
4
7
|
//#endregion
|
|
5
8
|
exports.IS_EXTENSION = IS_EXTENSION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/vitest.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"vitest.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/vitest.ts"],"sourcesContent":["/**\n * Flag indicating whether tests are executed within the VS Code Vitest extension.\n */\nexport const IS_EXTENSION = process.env.VITEST_VSCODE === 'true';\n"],"mappings":";;;;;AAGA,MAAa,eAAe,QAAQ,IAAI,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.js","names":[],"sources":["../../../src/vitest-extended/fixtures/vitest.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"vitest.js","names":[],"sources":["../../../src/vitest-extended/fixtures/vitest.ts"],"sourcesContent":["/**\n * Flag indicating whether tests are executed within the VS Code Vitest extension.\n */\nexport const IS_EXTENSION = process.env.VITEST_VSCODE === 'true';\n"],"mappings":";;;;AAGA,MAAa,eAAe,QAAQ,IAAI,kBAAkB"}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/vitest-extended/fixtures/zod.ts
|
|
3
|
+
/**
|
|
4
|
+
* Converts a Zod schema into a synchronous type-guard validation function.
|
|
5
|
+
*
|
|
6
|
+
* @template | {@linkcode Any} `T` - Zod schema type.
|
|
7
|
+
*
|
|
8
|
+
* @param zod - Zod schema instance.
|
|
9
|
+
*
|
|
10
|
+
* @returns Type guard validation function.
|
|
11
|
+
*/
|
|
3
12
|
const transformZodToFunction = (zod) => {
|
|
4
13
|
const f = (arg) => {
|
|
5
14
|
return zod.safeParse(arg).success;
|
|
6
15
|
};
|
|
7
16
|
return f;
|
|
8
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Alias for {@linkcode transformZodToFunction}.
|
|
20
|
+
*/
|
|
9
21
|
const transformZTF = transformZodToFunction;
|
|
22
|
+
/**
|
|
23
|
+
* Converts a Zod schema into an asynchronous boolean validation function.
|
|
24
|
+
*
|
|
25
|
+
* @param zod - Zod schema instance of type {@linkcode Any}.
|
|
26
|
+
*
|
|
27
|
+
* @returns Async validation function returning a boolean.
|
|
28
|
+
*/
|
|
10
29
|
const transformZodToFunctionAsync = (zod) => {
|
|
11
30
|
const f = async (arg) => {
|
|
12
31
|
return (await zod.safeParseAsync(arg)).success;
|
|
13
32
|
};
|
|
14
33
|
return f;
|
|
15
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Alias for {@linkcode transformZodToFunctionAsync}.
|
|
37
|
+
*/
|
|
16
38
|
const transformZTFAsync = transformZodToFunctionAsync;
|
|
17
39
|
//#endregion
|
|
18
40
|
exports.transformZTF = transformZTF;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/zod.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport type Any = z.ZodTypeAny;\n\nexport const transformZodToFunction = <T extends Any>(zod: T) => {\n type Z = z.infer<T>;\n\n const f = (arg: any): arg is Z => {\n return zod.safeParse(arg).success;\n };\n\n return f;\n};\n\nexport const transformZTF = transformZodToFunction;\n\nexport const transformZodToFunctionAsync = (zod: Any) => {\n const f = async (arg: any) => {\n const _zod = await zod.safeParseAsync(arg);\n return _zod.success;\n };\n\n return f;\n};\n\nexport const transformZTFAsync = transformZodToFunctionAsync;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"zod.cjs","names":[],"sources":["../../../src/vitest-extended/fixtures/zod.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Type alias for any Zod schema.\n */\nexport type Any = z.ZodTypeAny;\n\n/**\n * Converts a Zod schema into a synchronous type-guard validation function.\n *\n * @template | {@linkcode Any} `T` - Zod schema type.\n *\n * @param zod - Zod schema instance.\n *\n * @returns Type guard validation function.\n */\nexport const transformZodToFunction = <T extends Any>(zod: T) => {\n type Z = z.infer<T>;\n\n const f = (arg: any): arg is Z => {\n return zod.safeParse(arg).success;\n };\n\n return f;\n};\n\n/**\n * Alias for {@linkcode transformZodToFunction}.\n */\nexport const transformZTF = transformZodToFunction;\n\n/**\n * Converts a Zod schema into an asynchronous boolean validation function.\n *\n * @param zod - Zod schema instance of type {@linkcode Any}.\n *\n * @returns Async validation function returning a boolean.\n */\nexport const transformZodToFunctionAsync = (zod: Any) => {\n const f = async (arg: any) => {\n const _zod = await zod.safeParseAsync(arg);\n return _zod.success;\n };\n\n return f;\n};\n\n/**\n * Alias for {@linkcode transformZodToFunctionAsync}.\n */\nexport const transformZTFAsync = transformZodToFunctionAsync;\n"],"mappings":";;;;;;;;;;;AAgBA,MAAa,0BAAyC,QAAW;CAG/D,MAAM,KAAK,QAAuB;EAChC,OAAO,IAAI,UAAU,GAAG,CAAC,CAAC;CAC5B;CAEA,OAAO;AACT;;;;AAKA,MAAa,eAAe;;;;;;;;AAS5B,MAAa,+BAA+B,QAAa;CACvD,MAAM,IAAI,OAAO,QAAa;EAE5B,QAAO,MADY,IAAI,eAAe,GAAG,EAAA,CAC7B;CACd;CAEA,OAAO;AACT;;;;AAKA,MAAa,oBAAoB"}
|
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
//#region src/vitest-extended/fixtures/zod.ts
|
|
2
|
+
/**
|
|
3
|
+
* Converts a Zod schema into a synchronous type-guard validation function.
|
|
4
|
+
*
|
|
5
|
+
* @template | {@linkcode Any} `T` - Zod schema type.
|
|
6
|
+
*
|
|
7
|
+
* @param zod - Zod schema instance.
|
|
8
|
+
*
|
|
9
|
+
* @returns Type guard validation function.
|
|
10
|
+
*/
|
|
2
11
|
const transformZodToFunction = (zod) => {
|
|
3
12
|
const f = (arg) => {
|
|
4
13
|
return zod.safeParse(arg).success;
|
|
5
14
|
};
|
|
6
15
|
return f;
|
|
7
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Alias for {@linkcode transformZodToFunction}.
|
|
19
|
+
*/
|
|
8
20
|
const transformZTF = transformZodToFunction;
|
|
21
|
+
/**
|
|
22
|
+
* Converts a Zod schema into an asynchronous boolean validation function.
|
|
23
|
+
*
|
|
24
|
+
* @param zod - Zod schema instance of type {@linkcode Any}.
|
|
25
|
+
*
|
|
26
|
+
* @returns Async validation function returning a boolean.
|
|
27
|
+
*/
|
|
9
28
|
const transformZodToFunctionAsync = (zod) => {
|
|
10
29
|
const f = async (arg) => {
|
|
11
30
|
return (await zod.safeParseAsync(arg)).success;
|
|
12
31
|
};
|
|
13
32
|
return f;
|
|
14
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Alias for {@linkcode transformZodToFunctionAsync}.
|
|
36
|
+
*/
|
|
15
37
|
const transformZTFAsync = transformZodToFunctionAsync;
|
|
16
38
|
//#endregion
|
|
17
39
|
export { transformZTF, transformZTFAsync, transformZodToFunction, transformZodToFunctionAsync };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod.js","names":[],"sources":["../../../src/vitest-extended/fixtures/zod.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport type Any = z.ZodTypeAny;\n\nexport const transformZodToFunction = <T extends Any>(zod: T) => {\n type Z = z.infer<T>;\n\n const f = (arg: any): arg is Z => {\n return zod.safeParse(arg).success;\n };\n\n return f;\n};\n\nexport const transformZTF = transformZodToFunction;\n\nexport const transformZodToFunctionAsync = (zod: Any) => {\n const f = async (arg: any) => {\n const _zod = await zod.safeParseAsync(arg);\n return _zod.success;\n };\n\n return f;\n};\n\nexport const transformZTFAsync = transformZodToFunctionAsync;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"zod.js","names":[],"sources":["../../../src/vitest-extended/fixtures/zod.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Type alias for any Zod schema.\n */\nexport type Any = z.ZodTypeAny;\n\n/**\n * Converts a Zod schema into a synchronous type-guard validation function.\n *\n * @template | {@linkcode Any} `T` - Zod schema type.\n *\n * @param zod - Zod schema instance.\n *\n * @returns Type guard validation function.\n */\nexport const transformZodToFunction = <T extends Any>(zod: T) => {\n type Z = z.infer<T>;\n\n const f = (arg: any): arg is Z => {\n return zod.safeParse(arg).success;\n };\n\n return f;\n};\n\n/**\n * Alias for {@linkcode transformZodToFunction}.\n */\nexport const transformZTF = transformZodToFunction;\n\n/**\n * Converts a Zod schema into an asynchronous boolean validation function.\n *\n * @param zod - Zod schema instance of type {@linkcode Any}.\n *\n * @returns Async validation function returning a boolean.\n */\nexport const transformZodToFunctionAsync = (zod: Any) => {\n const f = async (arg: any) => {\n const _zod = await zod.safeParseAsync(arg);\n return _zod.success;\n };\n\n return f;\n};\n\n/**\n * Alias for {@linkcode transformZodToFunctionAsync}.\n */\nexport const transformZTFAsync = transformZodToFunctionAsync;\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,0BAAyC,QAAW;CAG/D,MAAM,KAAK,QAAuB;EAChC,OAAO,IAAI,UAAU,GAAG,CAAC,CAAC;CAC5B;CAEA,OAAO;AACT;;;;AAKA,MAAa,eAAe;;;;;;;;AAS5B,MAAa,+BAA+B,QAAa;CACvD,MAAM,IAAI,OAAO,QAAa;EAE5B,QAAO,MADY,IAAI,eAAe,GAAG,EAAA,CAC7B;CACd;CAEA,OAAO;AACT;;;;AAKA,MAAa,oBAAoB"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let vitest = require("vitest");
|
|
3
3
|
//#region src/vitest-extended/identity.ts
|
|
4
|
+
/**
|
|
5
|
+
* Identity function returning its argument unmodified.
|
|
6
|
+
*
|
|
7
|
+
* @template `T` - Type of the input value.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The input value.
|
|
10
|
+
*
|
|
11
|
+
* @returns The unchanged `value` of type `T`.
|
|
12
|
+
*/
|
|
4
13
|
const identity = (value) => value;
|
|
14
|
+
/**
|
|
15
|
+
* Default equality comparison using Vitest's `expect.toStrictEqual`. Sorts
|
|
16
|
+
* arrays prior to comparison.
|
|
17
|
+
*
|
|
18
|
+
* @param value - The actual received value.
|
|
19
|
+
* @param expected - The expected value.
|
|
20
|
+
*
|
|
21
|
+
* @returns The Vitest assertion result.
|
|
22
|
+
*/
|
|
5
23
|
const defaultEquality = (value, expected) => {
|
|
6
24
|
if (Array.isArray(value) && Array.isArray(expected)) return (0, vitest.expect)(value.sort()).toStrictEqual(expected.sort());
|
|
7
25
|
return (0, vitest.expect)(value).toStrictEqual(expected);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.cjs","names":[],"sources":["../../src/vitest-extended/identity.ts"],"sourcesContent":["import { expect } from 'vitest';\n\nexport const identity = <T>(value: T) => value;\n\nexport const defaultEquality = (value: any, expected: any) => {\n const checkArray = Array.isArray(value) && Array.isArray(expected);\n\n if (checkArray) {\n return expect(value.sort()).toStrictEqual(expected.sort());\n }\n return expect(value).toStrictEqual(expected);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"identity.cjs","names":["expect"],"sources":["../../src/vitest-extended/identity.ts"],"sourcesContent":["import { expect } from 'vitest';\n\n/**\n * Identity function returning its argument unmodified.\n *\n * @template `T` - Type of the input value.\n *\n * @param value - The input value.\n *\n * @returns The unchanged `value` of type `T`.\n */\nexport const identity = <T>(value: T) => value;\n\n/**\n * Default equality comparison using Vitest's `expect.toStrictEqual`. Sorts\n * arrays prior to comparison.\n *\n * @param value - The actual received value.\n * @param expected - The expected value.\n *\n * @returns The Vitest assertion result.\n */\nexport const defaultEquality = (value: any, expected: any) => {\n const checkArray = Array.isArray(value) && Array.isArray(expected);\n\n if (checkArray) {\n return expect(value.sort()).toStrictEqual(expected.sort());\n }\n return expect(value).toStrictEqual(expected);\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,YAAe,UAAa;;;;;;;;;;AAWzC,MAAa,mBAAmB,OAAY,aAAkB;CAG5D,IAFmB,MAAM,QAAQ,KAAK,KAAK,MAAM,QAAQ,QAAQ,GAG/D,QAAA,GAAOA,OAAAA,OAAAA,CAAO,MAAM,KAAK,CAAC,CAAC,CAAC,cAAc,SAAS,KAAK,CAAC;CAE3D,QAAA,GAAOA,OAAAA,OAAAA,CAAO,KAAK,CAAC,CAAC,cAAc,QAAQ;AAC7C"}
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity function returning its argument unmodified.
|
|
3
|
+
*
|
|
4
|
+
* @template `T` - Type of the input value.
|
|
5
|
+
*
|
|
6
|
+
* @param value - The input value.
|
|
7
|
+
*
|
|
8
|
+
* @returns The unchanged `value` of type `T`.
|
|
9
|
+
*/
|
|
1
10
|
export declare const identity: <T>(value: T) => T;
|
|
11
|
+
/**
|
|
12
|
+
* Default equality comparison using Vitest's `expect.toStrictEqual`. Sorts
|
|
13
|
+
* arrays prior to comparison.
|
|
14
|
+
*
|
|
15
|
+
* @param value - The actual received value.
|
|
16
|
+
* @param expected - The expected value.
|
|
17
|
+
*
|
|
18
|
+
* @returns The Vitest assertion result.
|
|
19
|
+
*/
|
|
2
20
|
export declare const defaultEquality: (value: any, expected: any) => void;
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { expect } from "vitest";
|
|
2
2
|
//#region src/vitest-extended/identity.ts
|
|
3
|
+
/**
|
|
4
|
+
* Identity function returning its argument unmodified.
|
|
5
|
+
*
|
|
6
|
+
* @template `T` - Type of the input value.
|
|
7
|
+
*
|
|
8
|
+
* @param value - The input value.
|
|
9
|
+
*
|
|
10
|
+
* @returns The unchanged `value` of type `T`.
|
|
11
|
+
*/
|
|
3
12
|
const identity = (value) => value;
|
|
13
|
+
/**
|
|
14
|
+
* Default equality comparison using Vitest's `expect.toStrictEqual`. Sorts
|
|
15
|
+
* arrays prior to comparison.
|
|
16
|
+
*
|
|
17
|
+
* @param value - The actual received value.
|
|
18
|
+
* @param expected - The expected value.
|
|
19
|
+
*
|
|
20
|
+
* @returns The Vitest assertion result.
|
|
21
|
+
*/
|
|
4
22
|
const defaultEquality = (value, expected) => {
|
|
5
23
|
if (Array.isArray(value) && Array.isArray(expected)) return expect(value.sort()).toStrictEqual(expected.sort());
|
|
6
24
|
return expect(value).toStrictEqual(expected);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","names":[],"sources":["../../src/vitest-extended/identity.ts"],"sourcesContent":["import { expect } from 'vitest';\n\nexport const identity = <T>(value: T) => value;\n\nexport const defaultEquality = (value: any, expected: any) => {\n const checkArray = Array.isArray(value) && Array.isArray(expected);\n\n if (checkArray) {\n return expect(value.sort()).toStrictEqual(expected.sort());\n }\n return expect(value).toStrictEqual(expected);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"identity.js","names":[],"sources":["../../src/vitest-extended/identity.ts"],"sourcesContent":["import { expect } from 'vitest';\n\n/**\n * Identity function returning its argument unmodified.\n *\n * @template `T` - Type of the input value.\n *\n * @param value - The input value.\n *\n * @returns The unchanged `value` of type `T`.\n */\nexport const identity = <T>(value: T) => value;\n\n/**\n * Default equality comparison using Vitest's `expect.toStrictEqual`. Sorts\n * arrays prior to comparison.\n *\n * @param value - The actual received value.\n * @param expected - The expected value.\n *\n * @returns The Vitest assertion result.\n */\nexport const defaultEquality = (value: any, expected: any) => {\n const checkArray = Array.isArray(value) && Array.isArray(expected);\n\n if (checkArray) {\n return expect(value.sort()).toStrictEqual(expected.sort());\n }\n return expect(value).toStrictEqual(expected);\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,YAAe,UAAa;;;;;;;;;;AAWzC,MAAa,mBAAmB,OAAY,aAAkB;CAG5D,IAFmB,MAAM,QAAQ,KAAK,KAAK,MAAM,QAAQ,QAAQ,GAG/D,OAAO,OAAO,MAAM,KAAK,CAAC,CAAC,CAAC,cAAc,SAAS,KAAK,CAAC;CAE3D,OAAO,OAAO,KAAK,CAAC,CAAC,cAAc,QAAQ;AAC7C"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/vitest-extended/isDefined.ts
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if a value is defined (not `null` and not `undefined`).
|
|
5
|
+
*
|
|
6
|
+
* @template `T` - Type of the value to test.
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to check of type {@linkcode Undefiny}.
|
|
9
|
+
*
|
|
10
|
+
* @returns `true` if `value` is defined, otherwise `false`.
|
|
11
|
+
*/
|
|
3
12
|
const isDefined = (value) => {
|
|
4
13
|
return value !== void 0 && value !== null;
|
|
5
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDefined.cjs","names":[],"sources":["../../src/vitest-extended/isDefined.ts"],"sourcesContent":["import type { Undefiny } from '../utils/bemedev/globals/types';\nexport type { Undefiny };\n\nexport const isDefined = <T>(value?: Undefiny<T>): value is T => {\n return value !== undefined && value !== null;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isDefined.cjs","names":[],"sources":["../../src/vitest-extended/isDefined.ts"],"sourcesContent":["import type { Undefiny } from '../utils/bemedev/globals/types';\nexport type { Undefiny };\n\n/**\n * Type guard to check if a value is defined (not `null` and not `undefined`).\n *\n * @template `T` - Type of the value to test.\n *\n * @param value - The value to check of type {@linkcode Undefiny}.\n *\n * @returns `true` if `value` is defined, otherwise `false`.\n */\nexport const isDefined = <T>(value?: Undefiny<T>): value is T => {\n return value !== undefined && value !== null;\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAa,aAAgB,UAAoC;CAC/D,OAAO,UAAU,KAAA,KAAa,UAAU;AAC1C"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import type { Undefiny } from '../utils/bemedev/globals/types';
|
|
2
2
|
export type { Undefiny };
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if a value is defined (not `null` and not `undefined`).
|
|
5
|
+
*
|
|
6
|
+
* @template `T` - Type of the value to test.
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to check of type {@linkcode Undefiny}.
|
|
9
|
+
*
|
|
10
|
+
* @returns `true` if `value` is defined, otherwise `false`.
|
|
11
|
+
*/
|
|
3
12
|
export declare const isDefined: <T>(value?: Undefiny<T>) => value is T;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
//#region src/vitest-extended/isDefined.ts
|
|
2
|
+
/**
|
|
3
|
+
* Type guard to check if a value is defined (not `null` and not `undefined`).
|
|
4
|
+
*
|
|
5
|
+
* @template `T` - Type of the value to test.
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to check of type {@linkcode Undefiny}.
|
|
8
|
+
*
|
|
9
|
+
* @returns `true` if `value` is defined, otherwise `false`.
|
|
10
|
+
*/
|
|
2
11
|
const isDefined = (value) => {
|
|
3
12
|
return value !== void 0 && value !== null;
|
|
4
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDefined.js","names":[],"sources":["../../src/vitest-extended/isDefined.ts"],"sourcesContent":["import type { Undefiny } from '../utils/bemedev/globals/types';\nexport type { Undefiny };\n\nexport const isDefined = <T>(value?: Undefiny<T>): value is T => {\n return value !== undefined && value !== null;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isDefined.js","names":[],"sources":["../../src/vitest-extended/isDefined.ts"],"sourcesContent":["import type { Undefiny } from '../utils/bemedev/globals/types';\nexport type { Undefiny };\n\n/**\n * Type guard to check if a value is defined (not `null` and not `undefined`).\n *\n * @template `T` - Type of the value to test.\n *\n * @param value - The value to check of type {@linkcode Undefiny}.\n *\n * @returns `true` if `value` is defined, otherwise `false`.\n */\nexport const isDefined = <T>(value?: Undefiny<T>): value is T => {\n return value !== undefined && value !== null;\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAa,aAAgB,UAAoC;CAC/D,OAAO,UAAU,KAAA,KAAa,UAAU;AAC1C"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/vitest-extended/isFunction.ts
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether the given value is a function.
|
|
5
|
+
*
|
|
6
|
+
* @param arg - The value to check.
|
|
7
|
+
*
|
|
8
|
+
* @returns `true` if `arg` is a function, otherwise `false`.
|
|
9
|
+
*/
|
|
3
10
|
function isFunction(arg) {
|
|
4
11
|
const isType = "function" === typeof arg;
|
|
5
12
|
const isInstance = arg instanceof Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isFunction.cjs","names":[],"sources":["../../src/vitest-extended/isFunction.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"isFunction.cjs","names":[],"sources":["../../src/vitest-extended/isFunction.ts"],"sourcesContent":["/**\n * Determines whether the given value is a function.\n *\n * @param arg - The value to check.\n *\n * @returns `true` if `arg` is a function, otherwise `false`.\n */\nexport function isFunction(arg: any) {\n const isType = 'function' === typeof arg;\n const isInstance = arg instanceof Function;\n const isArrow =\n Object.prototype.toString.call(arg) === '[object Function]';\n\n return !!arg && (isType || isInstance || isArrow);\n}\n"],"mappings":";;;;;;;;;AAOA,SAAgB,WAAW,KAAU;CACnC,MAAM,SAAS,eAAe,OAAO;CACrC,MAAM,aAAa,eAAe;CAClC,MAAM,UACJ,OAAO,UAAU,SAAS,KAAK,GAAG,MAAM;CAE1C,OAAO,CAAC,CAAC,QAAQ,UAAU,cAAc;AAC3C"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
//#region src/vitest-extended/isFunction.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether the given value is a function.
|
|
4
|
+
*
|
|
5
|
+
* @param arg - The value to check.
|
|
6
|
+
*
|
|
7
|
+
* @returns `true` if `arg` is a function, otherwise `false`.
|
|
8
|
+
*/
|
|
2
9
|
function isFunction(arg) {
|
|
3
10
|
const isType = "function" === typeof arg;
|
|
4
11
|
const isInstance = arg instanceof Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isFunction.js","names":[],"sources":["../../src/vitest-extended/isFunction.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"isFunction.js","names":[],"sources":["../../src/vitest-extended/isFunction.ts"],"sourcesContent":["/**\n * Determines whether the given value is a function.\n *\n * @param arg - The value to check.\n *\n * @returns `true` if `arg` is a function, otherwise `false`.\n */\nexport function isFunction(arg: any) {\n const isType = 'function' === typeof arg;\n const isInstance = arg instanceof Function;\n const isArrow =\n Object.prototype.toString.call(arg) === '[object Function]';\n\n return !!arg && (isType || isInstance || isArrow);\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,WAAW,KAAU;CACnC,MAAM,SAAS,eAAe,OAAO;CACrC,MAAM,aAAa,eAAe;CAClC,MAAM,UACJ,OAAO,UAAU,SAAS,KAAK,GAAG,MAAM;CAE1C,OAAO,CAAC,CAAC,QAAQ,UAAU,cAAc;AAC3C"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let vitest_config = require("vitest/config");
|
|
3
3
|
//#region src/vitest-extended/project.ts
|
|
4
|
+
/**
|
|
5
|
+
* Helper function to define a Vitest project configuration with defaults.
|
|
6
|
+
*
|
|
7
|
+
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
8
|
+
*
|
|
9
|
+
* @returns Configured Vitest project configuration.
|
|
10
|
+
*/
|
|
4
11
|
const defineProject = (conf) => {
|
|
5
12
|
const _env = conf.test?.env ?? {};
|
|
6
13
|
return (0, vitest_config.defineConfig)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.cjs","names":[],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineConfig, type UserWorkspaceConfig } from 'vitest/config';\n\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return defineConfig({\n resolve: { tsconfigPaths: true },\n ...conf,\n test: {\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n ...conf.test,\n },\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.cjs","names":["defineConfig"],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineConfig, 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.\n */\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return defineConfig({\n resolve: { tsconfigPaths: true },\n ...conf,\n test: {\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n ...conf.test,\n },\n });\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,iBAAiB,SAA8B;CAC1D,MAAM,OAAO,KAAK,MAAM,OAAO,CAAC;CAEhC,QAAA,GAAOA,cAAAA,aAAAA,CAAa;EAClB,SAAS,EAAE,eAAe,KAAK;EAC/B,GAAG;EACH,MAAM;GACJ,SAAS;GACT,cAAc;GACd,KAAK;IAAE,UAAU;IAAQ,GAAG;GAAK;GACjC,GAAG,KAAK;EACV;CACF,CAAC;AACH"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { type UserWorkspaceConfig } from 'vitest/config';
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to define a Vitest project configuration with defaults.
|
|
4
|
+
*
|
|
5
|
+
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
6
|
+
*
|
|
7
|
+
* @returns Configured Vitest project configuration.
|
|
8
|
+
*/
|
|
2
9
|
export declare const defineProject: (conf: UserWorkspaceConfig) => import("vite").UserConfig;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { defineConfig } from "vitest/config";
|
|
2
2
|
//#region src/vitest-extended/project.ts
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to define a Vitest project configuration with defaults.
|
|
5
|
+
*
|
|
6
|
+
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
7
|
+
*
|
|
8
|
+
* @returns Configured Vitest project configuration.
|
|
9
|
+
*/
|
|
3
10
|
const defineProject = (conf) => {
|
|
4
11
|
const _env = conf.test?.env ?? {};
|
|
5
12
|
return defineConfig({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","names":[],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineConfig, type UserWorkspaceConfig } from 'vitest/config';\n\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return defineConfig({\n resolve: { tsconfigPaths: true },\n ...conf,\n test: {\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n ...conf.test,\n },\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.js","names":[],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineConfig, 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.\n */\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return defineConfig({\n resolve: { tsconfigPaths: true },\n ...conf,\n test: {\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n ...conf.test,\n },\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,iBAAiB,SAA8B;CAC1D,MAAM,OAAO,KAAK,MAAM,OAAO,CAAC;CAEhC,OAAO,aAAa;EAClB,SAAS,EAAE,eAAe,KAAK;EAC/B,GAAG;EACH,MAAM;GACJ,SAAS;GACT,cAAc;GACd,KAAK;IAAE,UAAU;IAAQ,GAAG;GAAK;GACjC,GAAG,KAAK;EACV;CACF,CAAC;AACH"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_vitest_extended_isDefined = require("./isDefined.cjs");
|
|
3
3
|
//#region src/vitest-extended/toArray.ts
|
|
4
|
+
/**
|
|
5
|
+
* Transforms test case arguments into the tuple format expected by Vitest each runners.
|
|
6
|
+
*/
|
|
4
7
|
const toArrayVitest = (args) => {
|
|
5
8
|
return args.map(({ expected, invite, parameters: params, test }) => {
|
|
6
9
|
return [
|
|
@@ -20,6 +23,9 @@ toArrayVitest.error = (args) => {
|
|
|
20
23
|
];
|
|
21
24
|
});
|
|
22
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes a single value, array, null, or undefined into an array.
|
|
28
|
+
*/
|
|
23
29
|
const toArray = (obj) => {
|
|
24
30
|
if (Array.isArray(obj)) return obj;
|
|
25
31
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toArray.cjs","names":["isDefined"],"sources":["../../src/vitest-extended/toArray.ts"],"sourcesContent":["import { isDefined } from './isDefined';\nimport type { ToArrayVitest_F, ToArray_F } from './types';\n\nexport const toArrayVitest: ToArrayVitest_F = args => {\n return args.map(({ expected, invite, parameters: params, test }) => {\n const parameters = toArray(params);\n return [invite, parameters, expected, test] as any;\n });\n};\n\ntoArrayVitest.error = args => {\n return args.map(({ invite, parameters: params, error }) => {\n const parameters = toArray.generic(params);\n return [invite, parameters, error] as any;\n });\n};\n\nexport const toArray: ToArray_F = obj => {\n if (Array.isArray(obj)) {\n return obj;\n } else {\n const isNotDefined = !isDefined(obj);\n if (isNotDefined) return [];\n\n return [obj];\n }\n};\n\ntoArray.generic = obj => toArray(obj) as any;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toArray.cjs","names":["isDefined"],"sources":["../../src/vitest-extended/toArray.ts"],"sourcesContent":["import { isDefined } from './isDefined';\nimport type { ToArrayVitest_F, ToArray_F } from './types';\n\n/**\n * Transforms test case arguments into the tuple format expected by Vitest each runners.\n */\nexport const toArrayVitest: ToArrayVitest_F = args => {\n return args.map(({ expected, invite, parameters: params, test }) => {\n const parameters = toArray(params);\n return [invite, parameters, expected, test] as any;\n });\n};\n\ntoArrayVitest.error = args => {\n return args.map(({ invite, parameters: params, error }) => {\n const parameters = toArray.generic(params);\n return [invite, parameters, error] as any;\n });\n};\n\n/**\n * Normalizes a single value, array, null, or undefined into an array.\n */\nexport const toArray: ToArray_F = obj => {\n if (Array.isArray(obj)) {\n return obj;\n } else {\n const isNotDefined = !isDefined(obj);\n if (isNotDefined) return [];\n\n return [obj];\n }\n};\n\ntoArray.generic = obj => toArray(obj) as any;\n"],"mappings":";;;;;;AAMA,MAAa,iBAAiC,SAAQ;CACpD,OAAO,KAAK,KAAK,EAAE,UAAU,QAAQ,YAAY,QAAQ,WAAW;EAElE,OAAO;GAAC;GADW,QAAQ,MACF;GAAG;GAAU;EAAI;CAC5C,CAAC;AACH;AAEA,cAAc,SAAQ,SAAQ;CAC5B,OAAO,KAAK,KAAK,EAAE,QAAQ,YAAY,QAAQ,YAAY;EAEzD,OAAO;GAAC;GADW,QAAQ,QAAQ,MACV;GAAG;EAAK;CACnC,CAAC;AACH;;;;AAKA,MAAa,WAAqB,QAAO;CACvC,IAAI,MAAM,QAAQ,GAAG,GACnB,OAAO;MACF;EAEL,IAAI,CADkBA,kCAAAA,UAAU,GAAG,GACjB,OAAO,CAAC;EAE1B,OAAO,CAAC,GAAG;CACb;AACF;AAEA,QAAQ,WAAU,QAAO,QAAQ,GAAG"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { ToArrayVitest_F, ToArray_F } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms test case arguments into the tuple format expected by Vitest each runners.
|
|
4
|
+
*/
|
|
2
5
|
export declare const toArrayVitest: ToArrayVitest_F;
|
|
6
|
+
/**
|
|
7
|
+
* Normalizes a single value, array, null, or undefined into an array.
|
|
8
|
+
*/
|
|
3
9
|
export declare const toArray: ToArray_F;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { isDefined } from "./isDefined.js";
|
|
2
2
|
//#region src/vitest-extended/toArray.ts
|
|
3
|
+
/**
|
|
4
|
+
* Transforms test case arguments into the tuple format expected by Vitest each runners.
|
|
5
|
+
*/
|
|
3
6
|
const toArrayVitest = (args) => {
|
|
4
7
|
return args.map(({ expected, invite, parameters: params, test }) => {
|
|
5
8
|
return [
|
|
@@ -19,6 +22,9 @@ toArrayVitest.error = (args) => {
|
|
|
19
22
|
];
|
|
20
23
|
});
|
|
21
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Normalizes a single value, array, null, or undefined into an array.
|
|
27
|
+
*/
|
|
22
28
|
const toArray = (obj) => {
|
|
23
29
|
if (Array.isArray(obj)) return obj;
|
|
24
30
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toArray.js","names":[],"sources":["../../src/vitest-extended/toArray.ts"],"sourcesContent":["import { isDefined } from './isDefined';\nimport type { ToArrayVitest_F, ToArray_F } from './types';\n\nexport const toArrayVitest: ToArrayVitest_F = args => {\n return args.map(({ expected, invite, parameters: params, test }) => {\n const parameters = toArray(params);\n return [invite, parameters, expected, test] as any;\n });\n};\n\ntoArrayVitest.error = args => {\n return args.map(({ invite, parameters: params, error }) => {\n const parameters = toArray.generic(params);\n return [invite, parameters, error] as any;\n });\n};\n\nexport const toArray: ToArray_F = obj => {\n if (Array.isArray(obj)) {\n return obj;\n } else {\n const isNotDefined = !isDefined(obj);\n if (isNotDefined) return [];\n\n return [obj];\n }\n};\n\ntoArray.generic = obj => toArray(obj) as any;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toArray.js","names":[],"sources":["../../src/vitest-extended/toArray.ts"],"sourcesContent":["import { isDefined } from './isDefined';\nimport type { ToArrayVitest_F, ToArray_F } from './types';\n\n/**\n * Transforms test case arguments into the tuple format expected by Vitest each runners.\n */\nexport const toArrayVitest: ToArrayVitest_F = args => {\n return args.map(({ expected, invite, parameters: params, test }) => {\n const parameters = toArray(params);\n return [invite, parameters, expected, test] as any;\n });\n};\n\ntoArrayVitest.error = args => {\n return args.map(({ invite, parameters: params, error }) => {\n const parameters = toArray.generic(params);\n return [invite, parameters, error] as any;\n });\n};\n\n/**\n * Normalizes a single value, array, null, or undefined into an array.\n */\nexport const toArray: ToArray_F = obj => {\n if (Array.isArray(obj)) {\n return obj;\n } else {\n const isNotDefined = !isDefined(obj);\n if (isNotDefined) return [];\n\n return [obj];\n }\n};\n\ntoArray.generic = obj => toArray(obj) as any;\n"],"mappings":";;;;;AAMA,MAAa,iBAAiC,SAAQ;CACpD,OAAO,KAAK,KAAK,EAAE,UAAU,QAAQ,YAAY,QAAQ,WAAW;EAElE,OAAO;GAAC;GADW,QAAQ,MACF;GAAG;GAAU;EAAI;CAC5C,CAAC;AACH;AAEA,cAAc,SAAQ,SAAQ;CAC5B,OAAO,KAAK,KAAK,EAAE,QAAQ,YAAY,QAAQ,YAAY;EAEzD,OAAO;GAAC;GADW,QAAQ,QAAQ,MACV;GAAG;EAAK;CACnC,CAAC;AACH;;;;AAKA,MAAa,WAAqB,QAAO;CACvC,IAAI,MAAM,QAAQ,GAAG,GACnB,OAAO;MACF;EAEL,IAAI,CADkB,UAAU,GAAG,GACjB,OAAO,CAAC;EAE1B,OAAO,CAAC,GAAG;CACb;AACF;AAEA,QAAQ,WAAU,QAAO,QAAQ,GAAG"}
|
|
@@ -3,6 +3,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const log10 = (value) => {
|
|
4
4
|
return Math.floor(Math.log10(value));
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Formats a number as a zero-padded string relative to the maximum length's magnitude.
|
|
8
|
+
*
|
|
9
|
+
* @param _value - Number value to format.
|
|
10
|
+
* @param _len - Maximum upper bound length for digit padding calculation.
|
|
11
|
+
*
|
|
12
|
+
* @returns Zero-padded string representation of `_value`.
|
|
13
|
+
*/
|
|
6
14
|
const toStringFlat = (_value, _len) => {
|
|
7
15
|
const length = log10(_len) - log10(_value);
|
|
8
16
|
let out = "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toStringFlat.cjs","names":[],"sources":["../../src/vitest-extended/toStringFlat.ts"],"sourcesContent":["import { type Fn } from '../utils/bemedev/globals/types';\n\nconst log10: Fn<[value: number], number> = (value: number) => {\n return Math.floor(Math.log10(value));\n};\n\nexport const toStringFlat: Fn<[value: number, len: number], string> = (\n _value,\n _len,\n) => {\n const logLength = log10(_len);\n const logValue = log10(_value);\n const length = logLength - logValue;\n\n let out = '';\n Array.from({ length }).forEach(() => {\n out += '0';\n });\n\n out += _value;\n\n return out;\n};\n"],"mappings":";;AAEA,MAAM,SAAsC,UAAkB;CAC5D,OAAO,KAAK,MAAM,KAAK,MAAM,KAAK,CAAC;AACrC
|
|
1
|
+
{"version":3,"file":"toStringFlat.cjs","names":[],"sources":["../../src/vitest-extended/toStringFlat.ts"],"sourcesContent":["import { type Fn } from '../utils/bemedev/globals/types';\n\nconst log10: Fn<[value: number], number> = (value: number) => {\n return Math.floor(Math.log10(value));\n};\n\n/**\n * Formats a number as a zero-padded string relative to the maximum length's magnitude.\n *\n * @param _value - Number value to format.\n * @param _len - Maximum upper bound length for digit padding calculation.\n *\n * @returns Zero-padded string representation of `_value`.\n */\nexport const toStringFlat: Fn<[value: number, len: number], string> = (\n _value,\n _len,\n) => {\n const logLength = log10(_len);\n const logValue = log10(_value);\n const length = logLength - logValue;\n\n let out = '';\n Array.from({ length }).forEach(() => {\n out += '0';\n });\n\n out += _value;\n\n return out;\n};\n"],"mappings":";;AAEA,MAAM,SAAsC,UAAkB;CAC5D,OAAO,KAAK,MAAM,KAAK,MAAM,KAAK,CAAC;AACrC;;;;;;;;;AAUA,MAAa,gBACX,QACA,SACG;CAGH,MAAM,SAFY,MAAM,IAED,IADN,MAAM,MACW;CAElC,IAAI,MAAM;CACV,MAAM,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc;EACnC,OAAO;CACT,CAAC;CAED,OAAO;CAEP,OAAO;AACT"}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { type Fn } from '../utils/bemedev/globals/types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a number as a zero-padded string relative to the maximum length's magnitude.
|
|
4
|
+
*
|
|
5
|
+
* @param _value - Number value to format.
|
|
6
|
+
* @param _len - Maximum upper bound length for digit padding calculation.
|
|
7
|
+
*
|
|
8
|
+
* @returns Zero-padded string representation of `_value`.
|
|
9
|
+
*/
|
|
2
10
|
export declare const toStringFlat: Fn<[value: number, len: number], string>;
|