@nr1e/commons 0.4.9 → 0.4.11
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/paraglide/messages/_index.d.ts +3 -1
- package/dist/paraglide/messages/_index.d.ts.map +1 -1
- package/dist/paraglide/messages/_index.js +3 -1
- package/dist/paraglide/messages/_index.js.map +1 -1
- package/dist/paraglide/messages/v_invalidvalue1.d.ts +18 -0
- package/dist/paraglide/messages/v_invalidvalue1.d.ts.map +1 -0
- package/dist/paraglide/messages/v_invalidvalue1.js +72 -0
- package/dist/paraglide/messages/v_invalidvalue1.js.map +1 -0
- package/dist/paraglide/messages/v_overprecision1.d.ts +20 -0
- package/dist/paraglide/messages/v_overprecision1.d.ts.map +1 -0
- package/dist/paraglide/messages/v_overprecision1.js +72 -0
- package/dist/paraglide/messages/v_overprecision1.js.map +1 -0
- package/dist/valibot/index.d.ts +2 -0
- package/dist/valibot/index.d.ts.map +1 -1
- package/dist/valibot/index.js +2 -0
- package/dist/valibot/index.js.map +1 -1
- package/dist/valibot/number-string.d.ts +19 -0
- package/dist/valibot/number-string.d.ts.map +1 -0
- package/dist/valibot/number-string.js +300 -0
- package/dist/valibot/number-string.js.map +1 -0
- package/dist/valibot/number-string.test.d.ts +2 -0
- package/dist/valibot/number-string.test.d.ts.map +1 -0
- package/dist/valibot/number-string.test.js +104 -0
- package/dist/valibot/number-string.test.js.map +1 -0
- package/dist/valibot/string-boolean.d.ts +9 -0
- package/dist/valibot/string-boolean.d.ts.map +1 -0
- package/dist/valibot/string-boolean.js +25 -0
- package/dist/valibot/string-boolean.js.map +1 -0
- package/dist/valibot/string-boolean.test.d.ts +2 -0
- package/dist/valibot/string-boolean.test.d.ts.map +1 -0
- package/dist/valibot/string-boolean.test.js +31 -0
- package/dist/valibot/string-boolean.test.js.map +1 -0
- package/dist/valibot/string-number.d.ts +4 -56
- package/dist/valibot/string-number.d.ts.map +1 -1
- package/dist/valibot/string-number.js +37 -137
- package/dist/valibot/string-number.js.map +1 -1
- package/dist/valibot/string-number.test.js +61 -8
- package/dist/valibot/string-number.test.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from "./v_nan2.js";
|
|
2
1
|
export * from "./v_atleast1.js";
|
|
3
2
|
export * from "./v_atmost1.js";
|
|
3
|
+
export * from "./v_invalidvalue1.js";
|
|
4
|
+
export * from "./v_nan2.js";
|
|
5
|
+
export * from "./v_overprecision1.js";
|
|
4
6
|
export type LocalizedString = import("../runtime.js").LocalizedString;
|
|
5
7
|
//# sourceMappingURL=_index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_index.d.ts","sourceRoot":"","sources":["../../../src/paraglide/messages/_index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_index.d.ts","sourceRoot":"","sources":["../../../src/paraglide/messages/_index.js"],"names":[],"mappings":";;;;;8BACc,OAAO,eAAe,EAAE,eAAe"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
3
|
-
export * from './v_nan2.js';
|
|
4
3
|
export * from './v_atleast1.js';
|
|
5
4
|
export * from './v_atmost1.js';
|
|
5
|
+
export * from './v_invalidvalue1.js';
|
|
6
|
+
export * from './v_nan2.js';
|
|
7
|
+
export * from './v_overprecision1.js';
|
|
6
8
|
//# sourceMappingURL=_index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_index.js","sourceRoot":"","sources":["../../../src/paraglide/messages/_index.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,yEAAyE;AACzE,cAAc,
|
|
1
|
+
{"version":3,"file":"_index.js","sourceRoot":"","sources":["../../../src/paraglide/messages/_index.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,yEAAyE;AACzE,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { v_invalidvalue1 as v_invalidValue };
|
|
2
|
+
export type LocalizedString = import("../runtime.js").LocalizedString;
|
|
3
|
+
export type V_Invalidvalue1Inputs = {};
|
|
4
|
+
/**
|
|
5
|
+
* | output |
|
|
6
|
+
* | --- |
|
|
7
|
+
* | "Not a valid value" |
|
|
8
|
+
*
|
|
9
|
+
* @param {V_Invalidvalue1Inputs} inputs
|
|
10
|
+
* @param {{ locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }} options
|
|
11
|
+
* @returns {LocalizedString}
|
|
12
|
+
*/
|
|
13
|
+
declare const v_invalidvalue1: ((inputs?: V_Invalidvalue1Inputs, options?: {
|
|
14
|
+
locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR";
|
|
15
|
+
}) => LocalizedString) & import("../runtime.js").MessageMetadata<V_Invalidvalue1Inputs, {
|
|
16
|
+
locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR";
|
|
17
|
+
}, {}>;
|
|
18
|
+
//# sourceMappingURL=v_invalidvalue1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v_invalidvalue1.d.ts","sourceRoot":"","sources":["../../../src/paraglide/messages/v_invalidvalue1.js"],"names":[],"mappings":";8BAGc,OAAO,eAAe,EAAE,eAAe;oCAEvC,EAAE;AA8ChB;;;;;;;;EAQE;AACF,+BAAmC,CAAC,CAAC,MAAM,CAAC,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,CAAA;CAAE,KAAK,eAAe,CAAC,GAAG,OAAO,eAAe,EAAE,eAAe,CAAC,qBAAqB,EAAE;IAAE,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,CAAA;CAAE,EAAE,EAAE,CAAC,CAa1X"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
/** @typedef {{}} V_Invalidvalue1Inputs */
|
|
5
|
+
const af_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Nie 'n geldige waarde nie`);
|
|
7
|
+
};
|
|
8
|
+
const ar_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
9
|
+
return /** @type {LocalizedString} */ (`قيمة غير صالحة`);
|
|
10
|
+
};
|
|
11
|
+
const en_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
12
|
+
return /** @type {LocalizedString} */ (`Not a valid value`);
|
|
13
|
+
};
|
|
14
|
+
const en_gb2_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
15
|
+
return /** @type {LocalizedString} */ (`Not a valid value`);
|
|
16
|
+
};
|
|
17
|
+
const en_us2_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
18
|
+
return /** @type {LocalizedString} */ (`Not a valid value`);
|
|
19
|
+
};
|
|
20
|
+
const en_za2_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
21
|
+
return /** @type {LocalizedString} */ (`Not a valid value`);
|
|
22
|
+
};
|
|
23
|
+
const es_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
24
|
+
return /** @type {LocalizedString} */ (`Valor no válido`);
|
|
25
|
+
};
|
|
26
|
+
const es_us2_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
27
|
+
return /** @type {LocalizedString} */ (`Valor no válido`);
|
|
28
|
+
};
|
|
29
|
+
const fr_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
30
|
+
return /** @type {LocalizedString} */ (`Valeur invalide`);
|
|
31
|
+
};
|
|
32
|
+
const fr_ca2_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
33
|
+
return /** @type {LocalizedString} */ (`Valeur invalide`);
|
|
34
|
+
};
|
|
35
|
+
const fr_fr2_v_invalidvalue1 = /** @type {(inputs: V_Invalidvalue1Inputs) => LocalizedString} */ () => {
|
|
36
|
+
return /** @type {LocalizedString} */ (`Valeur invalide`);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* | output |
|
|
40
|
+
* | --- |
|
|
41
|
+
* | "Not a valid value" |
|
|
42
|
+
*
|
|
43
|
+
* @param {V_Invalidvalue1Inputs} inputs
|
|
44
|
+
* @param {{ locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }} options
|
|
45
|
+
* @returns {LocalizedString}
|
|
46
|
+
*/
|
|
47
|
+
const v_invalidvalue1 = /** @type {((inputs?: V_Invalidvalue1Inputs, options?: { locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }) => LocalizedString) & import('../runtime.js').MessageMetadata<V_Invalidvalue1Inputs, { locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }, {}>} */ ((inputs = {}, options = {}) => {
|
|
48
|
+
const locale = experimentalStaticLocale ?? options.locale ?? getLocale();
|
|
49
|
+
if (locale === "af")
|
|
50
|
+
return af_v_invalidvalue1(inputs);
|
|
51
|
+
if (locale === "ar")
|
|
52
|
+
return ar_v_invalidvalue1(inputs);
|
|
53
|
+
if (locale === "en")
|
|
54
|
+
return en_v_invalidvalue1(inputs);
|
|
55
|
+
if (locale === "en-GB")
|
|
56
|
+
return en_gb2_v_invalidvalue1(inputs);
|
|
57
|
+
if (locale === "en-US")
|
|
58
|
+
return en_us2_v_invalidvalue1(inputs);
|
|
59
|
+
if (locale === "en-ZA")
|
|
60
|
+
return en_za2_v_invalidvalue1(inputs);
|
|
61
|
+
if (locale === "es")
|
|
62
|
+
return es_v_invalidvalue1(inputs);
|
|
63
|
+
if (locale === "es-US")
|
|
64
|
+
return es_us2_v_invalidvalue1(inputs);
|
|
65
|
+
if (locale === "fr")
|
|
66
|
+
return fr_v_invalidvalue1(inputs);
|
|
67
|
+
if (locale === "fr-CA")
|
|
68
|
+
return fr_ca2_v_invalidvalue1(inputs);
|
|
69
|
+
return fr_fr2_v_invalidvalue1(inputs);
|
|
70
|
+
});
|
|
71
|
+
export { v_invalidvalue1 as "v_invalidValue" };
|
|
72
|
+
//# sourceMappingURL=v_invalidvalue1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v_invalidvalue1.js","sourceRoot":"","sources":["../../../src/paraglide/messages/v_invalidvalue1.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEpE,yEAAyE;AAEzE,0CAA0C;AAE1C,MAAM,kB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|
1
|
+
export { v_overprecision1 as v_overPrecision };
|
|
2
|
+
export type LocalizedString = import("../runtime.js").LocalizedString;
|
|
3
|
+
export type V_Overprecision1Inputs = {
|
|
4
|
+
fractionDigits: NonNullable<unknown>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* | output |
|
|
8
|
+
* | --- |
|
|
9
|
+
* | "May only have {fractionDigits} decimal places" |
|
|
10
|
+
*
|
|
11
|
+
* @param {V_Overprecision1Inputs} inputs
|
|
12
|
+
* @param {{ locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }} options
|
|
13
|
+
* @returns {LocalizedString}
|
|
14
|
+
*/
|
|
15
|
+
declare const v_overprecision1: ((inputs: V_Overprecision1Inputs, options?: {
|
|
16
|
+
locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR";
|
|
17
|
+
}) => LocalizedString) & import("../runtime.js").MessageMetadata<V_Overprecision1Inputs, {
|
|
18
|
+
locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR";
|
|
19
|
+
}, {}>;
|
|
20
|
+
//# sourceMappingURL=v_overprecision1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v_overprecision1.d.ts","sourceRoot":"","sources":["../../../src/paraglide/messages/v_overprecision1.js"],"names":[],"mappings":";8BAGc,OAAO,eAAe,EAAE,eAAe;qCAEvC;IAAE,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAAE;AA8CtD;;;;;;;;EAQE;AACF,gCAAoC,CAAC,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,CAAA;CAAE,KAAK,eAAe,CAAC,GAAG,OAAO,eAAe,EAAE,eAAe,CAAC,sBAAsB,EAAE;IAAE,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,CAAA;CAAE,EAAE,EAAE,CAAC,CAa5X"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
/** @typedef {{ fractionDigits: NonNullable<unknown> }} V_Overprecision1Inputs */
|
|
5
|
+
const af_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Mag slegs ${i?.fractionDigits} desimale plekke hê`);
|
|
7
|
+
};
|
|
8
|
+
const ar_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
9
|
+
return /** @type {LocalizedString} */ (`قد يحتوي فقط على ${i?.fractionDigits} منزلة عشرية`);
|
|
10
|
+
};
|
|
11
|
+
const en_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
12
|
+
return /** @type {LocalizedString} */ (`May only have ${i?.fractionDigits} decimal places`);
|
|
13
|
+
};
|
|
14
|
+
const en_gb2_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
15
|
+
return /** @type {LocalizedString} */ (`May only have ${i?.fractionDigits} decimal places`);
|
|
16
|
+
};
|
|
17
|
+
const en_us2_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
18
|
+
return /** @type {LocalizedString} */ (`May only have ${i?.fractionDigits} decimal places`);
|
|
19
|
+
};
|
|
20
|
+
const en_za2_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
21
|
+
return /** @type {LocalizedString} */ (`May only have ${i?.fractionDigits} decimal places`);
|
|
22
|
+
};
|
|
23
|
+
const es_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
24
|
+
return /** @type {LocalizedString} */ (`Puede tener solo ${i?.fractionDigits} decimales`);
|
|
25
|
+
};
|
|
26
|
+
const es_us2_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
27
|
+
return /** @type {LocalizedString} */ (`Puede tener solo ${i?.fractionDigits} decimales`);
|
|
28
|
+
};
|
|
29
|
+
const fr_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
30
|
+
return /** @type {LocalizedString} */ (`Peut comporter seulement ${i?.fractionDigits} décimales`);
|
|
31
|
+
};
|
|
32
|
+
const fr_ca2_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
33
|
+
return /** @type {LocalizedString} */ (`Peut comporter seulement ${i?.fractionDigits} décimales`);
|
|
34
|
+
};
|
|
35
|
+
const fr_fr2_v_overprecision1 = /** @type {(inputs: V_Overprecision1Inputs) => LocalizedString} */ (i) => {
|
|
36
|
+
return /** @type {LocalizedString} */ (`Peut comporter seulement ${i?.fractionDigits} décimales`);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* | output |
|
|
40
|
+
* | --- |
|
|
41
|
+
* | "May only have {fractionDigits} decimal places" |
|
|
42
|
+
*
|
|
43
|
+
* @param {V_Overprecision1Inputs} inputs
|
|
44
|
+
* @param {{ locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }} options
|
|
45
|
+
* @returns {LocalizedString}
|
|
46
|
+
*/
|
|
47
|
+
const v_overprecision1 = /** @type {((inputs: V_Overprecision1Inputs, options?: { locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }) => LocalizedString) & import('../runtime.js').MessageMetadata<V_Overprecision1Inputs, { locale?: "af" | "ar" | "en" | "en-GB" | "en-US" | "en-ZA" | "es" | "es-US" | "fr" | "fr-CA" | "fr-FR" }, {}>} */ ((inputs, options = {}) => {
|
|
48
|
+
const locale = experimentalStaticLocale ?? options.locale ?? getLocale();
|
|
49
|
+
if (locale === "af")
|
|
50
|
+
return af_v_overprecision1(inputs);
|
|
51
|
+
if (locale === "ar")
|
|
52
|
+
return ar_v_overprecision1(inputs);
|
|
53
|
+
if (locale === "en")
|
|
54
|
+
return en_v_overprecision1(inputs);
|
|
55
|
+
if (locale === "en-GB")
|
|
56
|
+
return en_gb2_v_overprecision1(inputs);
|
|
57
|
+
if (locale === "en-US")
|
|
58
|
+
return en_us2_v_overprecision1(inputs);
|
|
59
|
+
if (locale === "en-ZA")
|
|
60
|
+
return en_za2_v_overprecision1(inputs);
|
|
61
|
+
if (locale === "es")
|
|
62
|
+
return es_v_overprecision1(inputs);
|
|
63
|
+
if (locale === "es-US")
|
|
64
|
+
return es_us2_v_overprecision1(inputs);
|
|
65
|
+
if (locale === "fr")
|
|
66
|
+
return fr_v_overprecision1(inputs);
|
|
67
|
+
if (locale === "fr-CA")
|
|
68
|
+
return fr_ca2_v_overprecision1(inputs);
|
|
69
|
+
return fr_fr2_v_overprecision1(inputs);
|
|
70
|
+
});
|
|
71
|
+
export { v_overprecision1 as "v_overPrecision" };
|
|
72
|
+
//# sourceMappingURL=v_overprecision1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v_overprecision1.js","sourceRoot":"","sources":["../../../src/paraglide/messages/v_overprecision1.js"],"names":[],"mappings":"AAAA,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AI,MAAM,KAAK,OAAO;QAAE,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA;IAC9D,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAA;IACvD,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA;IAC9D,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAA;IACvD,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA;IAC9D,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA;AACvC,CAAC,CAAC,CAAC;AACH,OAAO,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,CAAA"}
|
package/dist/valibot/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/valibot/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAC,CAAC,EAAC,CAAC;AACX,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/valibot/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAC,CAAC,EAAC,CAAC;AACX,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
package/dist/valibot/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/valibot/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAC,CAAC,EAAC,CAAC;AACX,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/valibot/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAC,CAAC,EAAC,CAAC;AACX,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { Locale } from './locale.js';
|
|
3
|
+
export declare function numberString(locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, string>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>]>;
|
|
4
|
+
export declare function numberStringEmptyNull(locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, string | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>], undefined>]>;
|
|
5
|
+
export declare function numberStringFixed(fractionDigits: number, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>;
|
|
6
|
+
export declare function numberStringFixedEmptyNull(fractionDigits: number, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>], undefined>]>;
|
|
7
|
+
export declare function numberStringMinimum(min: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, string | number>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>]>;
|
|
8
|
+
export declare function numberStringMaximum(max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, string | number>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>]>;
|
|
9
|
+
export declare function numberStringRange(min: number | string, max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, string | number>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>]>;
|
|
10
|
+
export declare function numberStringEmptyNullMinimum(min: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>]>], undefined>]>;
|
|
11
|
+
export declare function numberStringEmptyNullMaximum(max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>]>], undefined>]>;
|
|
12
|
+
export declare function numberStringEmptyNullRange(min: number | string, max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, import("../paraglide/runtime.js").LocalizedString>]>]>], undefined>]>;
|
|
13
|
+
export declare function numberStringFixedMinimum(fractionDigits: number, min: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>;
|
|
14
|
+
export declare function numberStringFixedMaximum(fractionDigits: number, max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>;
|
|
15
|
+
export declare function numberStringFixedRange(fractionDigits: number, min: number | string, max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>;
|
|
16
|
+
export declare function numberStringFixedEmptyNullMinimum(fractionDigits: number, min: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>], undefined>]>;
|
|
17
|
+
export declare function numberStringFixedEmptyNullMaximum(fractionDigits: number, max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>], undefined>]>;
|
|
18
|
+
export declare function numberStringFixedEmptyNullRange(fractionDigits: number, min: number | string, max: number | string, locale?: Locale): v.SchemaWithPipe<readonly [v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>, v.TransformAction<string | number, number | null>, v.UnionSchema<[v.NullSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.MinValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.MaxValueAction<number, number, import("../paraglide/runtime.js").LocalizedString>, v.CheckAction<number, import("../paraglide/runtime.js").LocalizedString>, v.TransformAction<number, string>, v.StringSchema<undefined>]>], undefined>]>;
|
|
19
|
+
//# sourceMappingURL=number-string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-string.d.ts","sourceRoot":"","sources":["../../src/valibot/number-string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGnC,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,+RAW3C;AAED,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,2VAiBpD;AAED,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,+WAwBxE;AAED,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,meA4BhB;AAED,wBAAgB,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AAG,EAAE,MAAM,GAAG,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,wjBA8BhB;AAED,wBAAgB,+BAA+B,CAC7C,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,6oBAgChB"}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { m } from '../paraglide/messages.js';
|
|
3
|
+
export function numberString(locale) {
|
|
4
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
5
|
+
if (typeof value === 'number')
|
|
6
|
+
return value.toString();
|
|
7
|
+
if (typeof value === 'string' && value.trim() !== '')
|
|
8
|
+
return Number(value.trim()).toString();
|
|
9
|
+
return value;
|
|
10
|
+
}), v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale }))));
|
|
11
|
+
}
|
|
12
|
+
export function numberStringEmptyNull(locale) {
|
|
13
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
14
|
+
if (typeof value === 'number')
|
|
15
|
+
return value.toString();
|
|
16
|
+
if (typeof value === 'string') {
|
|
17
|
+
const trimmed = value.trim();
|
|
18
|
+
if (trimmed === '')
|
|
19
|
+
return null;
|
|
20
|
+
return Number(trimmed).toString();
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}), v.union([
|
|
24
|
+
v.null(),
|
|
25
|
+
v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale }))),
|
|
26
|
+
]));
|
|
27
|
+
}
|
|
28
|
+
export function numberStringFixed(fractionDigits, locale) {
|
|
29
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
30
|
+
// 1. Normalize early (so we can validate consistently)
|
|
31
|
+
v.transform((value) => {
|
|
32
|
+
if (typeof value === 'number')
|
|
33
|
+
return value;
|
|
34
|
+
const trimmed = value.trim();
|
|
35
|
+
if (trimmed === '')
|
|
36
|
+
return NaN;
|
|
37
|
+
return Number(trimmed);
|
|
38
|
+
}),
|
|
39
|
+
// 2. Validate it's a valid number
|
|
40
|
+
v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })),
|
|
41
|
+
// 3. Validate decimal precision separately
|
|
42
|
+
v.check((value) => {
|
|
43
|
+
const shifted = value * 10 ** fractionDigits;
|
|
44
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
45
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })),
|
|
46
|
+
// 4. Format
|
|
47
|
+
v.transform((value) => value.toFixed(fractionDigits)), v.string());
|
|
48
|
+
}
|
|
49
|
+
export function numberStringFixedEmptyNull(fractionDigits, locale) {
|
|
50
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
51
|
+
// 1. Normalize early (so we can validate consistently)
|
|
52
|
+
v.transform((value) => {
|
|
53
|
+
if (typeof value === 'number')
|
|
54
|
+
return value;
|
|
55
|
+
const trimmed = value.trim();
|
|
56
|
+
if (trimmed === '')
|
|
57
|
+
return null;
|
|
58
|
+
return Number(trimmed);
|
|
59
|
+
}), v.union([
|
|
60
|
+
v.null(),
|
|
61
|
+
v.pipe(v.number(), v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })), v.check((value) => {
|
|
62
|
+
const shifted = value * 10 ** fractionDigits;
|
|
63
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
64
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })), v.transform((value) => value.toFixed(fractionDigits)), v.string()),
|
|
65
|
+
]));
|
|
66
|
+
}
|
|
67
|
+
export function numberStringMinimum(min, locale) {
|
|
68
|
+
if (typeof min === 'string')
|
|
69
|
+
min = Number(min);
|
|
70
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
71
|
+
if (typeof value === 'number')
|
|
72
|
+
return value;
|
|
73
|
+
if (typeof value === 'string' && value.trim() !== '') {
|
|
74
|
+
return Number(value.trim());
|
|
75
|
+
}
|
|
76
|
+
return value;
|
|
77
|
+
}), v.pipe(v.number(), v.minValue(min, m.v_atLeast({ min }, { locale })), v.transform((value) => value.toString())), v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale }))));
|
|
78
|
+
}
|
|
79
|
+
export function numberStringMaximum(max, locale) {
|
|
80
|
+
if (typeof max === 'string')
|
|
81
|
+
max = Number(max);
|
|
82
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
83
|
+
if (typeof value === 'number')
|
|
84
|
+
return value;
|
|
85
|
+
if (typeof value === 'string' && value.trim() !== '') {
|
|
86
|
+
return Number(value.trim());
|
|
87
|
+
}
|
|
88
|
+
return value;
|
|
89
|
+
}), v.pipe(v.number(), v.maxValue(max, m.v_atMost({ max }, { locale })), v.transform((value) => value.toString())), v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale }))));
|
|
90
|
+
}
|
|
91
|
+
export function numberStringRange(min, max, locale) {
|
|
92
|
+
if (typeof min === 'string')
|
|
93
|
+
min = Number(min);
|
|
94
|
+
if (typeof max === 'string')
|
|
95
|
+
max = Number(max);
|
|
96
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
97
|
+
if (typeof value === 'number')
|
|
98
|
+
return value;
|
|
99
|
+
if (typeof value === 'string' && value.trim() !== '') {
|
|
100
|
+
return Number(value.trim());
|
|
101
|
+
}
|
|
102
|
+
return value;
|
|
103
|
+
}), v.pipe(v.number(), v.minValue(min, m.v_atLeast({ min }, { locale })), v.maxValue(max, m.v_atMost({ max }, { locale })), v.transform((value) => value.toString())), v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale }))));
|
|
104
|
+
}
|
|
105
|
+
export function numberStringEmptyNullMinimum(min, locale) {
|
|
106
|
+
if (typeof min === 'string')
|
|
107
|
+
min = Number(min);
|
|
108
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
109
|
+
if (typeof value === 'number')
|
|
110
|
+
return value;
|
|
111
|
+
if (typeof value === 'string') {
|
|
112
|
+
const trimmed = value.trim();
|
|
113
|
+
if (trimmed === '')
|
|
114
|
+
return null;
|
|
115
|
+
return Number(trimmed);
|
|
116
|
+
}
|
|
117
|
+
return value;
|
|
118
|
+
}), v.union([
|
|
119
|
+
v.null(),
|
|
120
|
+
v.pipe(v.number(), v.minValue(min, m.v_atLeast({ min }, { locale })), v.transform((value) => value.toString()), v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale })))),
|
|
121
|
+
]));
|
|
122
|
+
}
|
|
123
|
+
export function numberStringEmptyNullMaximum(max, locale) {
|
|
124
|
+
if (typeof max === 'string')
|
|
125
|
+
max = Number(max);
|
|
126
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
127
|
+
if (typeof value === 'number')
|
|
128
|
+
return value;
|
|
129
|
+
if (typeof value === 'string') {
|
|
130
|
+
const trimmed = value.trim();
|
|
131
|
+
if (trimmed === '')
|
|
132
|
+
return null;
|
|
133
|
+
return Number(trimmed);
|
|
134
|
+
}
|
|
135
|
+
return value;
|
|
136
|
+
}), v.union([
|
|
137
|
+
v.null(),
|
|
138
|
+
v.pipe(v.number(), v.maxValue(max, m.v_atMost({ max }, { locale })), v.transform((value) => value.toString()), v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale })))),
|
|
139
|
+
]));
|
|
140
|
+
}
|
|
141
|
+
export function numberStringEmptyNullRange(min, max, locale) {
|
|
142
|
+
if (typeof min === 'string')
|
|
143
|
+
min = Number(min);
|
|
144
|
+
if (typeof max === 'string')
|
|
145
|
+
max = Number(max);
|
|
146
|
+
return v.pipe(v.union([v.number(), v.string()]), v.transform((value) => {
|
|
147
|
+
if (typeof value === 'number')
|
|
148
|
+
return value;
|
|
149
|
+
if (typeof value === 'string') {
|
|
150
|
+
const trimmed = value.trim();
|
|
151
|
+
if (trimmed === '')
|
|
152
|
+
return null;
|
|
153
|
+
return Number(trimmed);
|
|
154
|
+
}
|
|
155
|
+
return value;
|
|
156
|
+
}), v.union([
|
|
157
|
+
v.null(),
|
|
158
|
+
v.pipe(v.number(), v.minValue(min, m.v_atLeast({ min }, { locale })), v.maxValue(max, m.v_atMost({ max }, { locale })), v.transform((value) => value.toString()), v.pipe(v.string(), v.regex(/^-?\d+(\.\d+)?$/, m.v_NaN({}, { locale })))),
|
|
159
|
+
]));
|
|
160
|
+
}
|
|
161
|
+
export function numberStringFixedMinimum(fractionDigits, min, locale) {
|
|
162
|
+
if (typeof min === 'string')
|
|
163
|
+
min = Number(min);
|
|
164
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
165
|
+
// 1. Normalize early (so we can validate consistently)
|
|
166
|
+
v.transform((value) => {
|
|
167
|
+
if (typeof value === 'number')
|
|
168
|
+
return value;
|
|
169
|
+
const trimmed = value.trim();
|
|
170
|
+
if (trimmed === '')
|
|
171
|
+
return NaN;
|
|
172
|
+
return Number(trimmed);
|
|
173
|
+
}),
|
|
174
|
+
// 2. Validate it's a valid number
|
|
175
|
+
v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })),
|
|
176
|
+
// 3. Validate minimum
|
|
177
|
+
v.minValue(min, m.v_atLeast({ min }, { locale })),
|
|
178
|
+
// 4. Validate decimal precision
|
|
179
|
+
v.check((value) => {
|
|
180
|
+
const shifted = value * 10 ** fractionDigits;
|
|
181
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
182
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })),
|
|
183
|
+
// 5. Format
|
|
184
|
+
v.transform((value) => value.toFixed(fractionDigits)), v.string());
|
|
185
|
+
}
|
|
186
|
+
export function numberStringFixedMaximum(fractionDigits, max, locale) {
|
|
187
|
+
if (typeof max === 'string')
|
|
188
|
+
max = Number(max);
|
|
189
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
190
|
+
// 1. Normalize early (so we can validate consistently)
|
|
191
|
+
v.transform((value) => {
|
|
192
|
+
if (typeof value === 'number')
|
|
193
|
+
return value;
|
|
194
|
+
const trimmed = value.trim();
|
|
195
|
+
if (trimmed === '')
|
|
196
|
+
return NaN;
|
|
197
|
+
return Number(trimmed);
|
|
198
|
+
}),
|
|
199
|
+
// 2. Validate it's a valid number
|
|
200
|
+
v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })),
|
|
201
|
+
// 3. Validate maximum
|
|
202
|
+
v.maxValue(max, m.v_atMost({ max }, { locale })),
|
|
203
|
+
// 4. Validate decimal precision
|
|
204
|
+
v.check((value) => {
|
|
205
|
+
const shifted = value * 10 ** fractionDigits;
|
|
206
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
207
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })),
|
|
208
|
+
// 5. Format
|
|
209
|
+
v.transform((value) => value.toFixed(fractionDigits)), v.string());
|
|
210
|
+
}
|
|
211
|
+
export function numberStringFixedRange(fractionDigits, min, max, locale) {
|
|
212
|
+
if (typeof min === 'string')
|
|
213
|
+
min = Number(min);
|
|
214
|
+
if (typeof max === 'string')
|
|
215
|
+
max = Number(max);
|
|
216
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
217
|
+
// 1. Normalize early (so we can validate consistently)
|
|
218
|
+
v.transform((value) => {
|
|
219
|
+
if (typeof value === 'number')
|
|
220
|
+
return value;
|
|
221
|
+
const trimmed = value.trim();
|
|
222
|
+
if (trimmed === '')
|
|
223
|
+
return NaN;
|
|
224
|
+
return Number(trimmed);
|
|
225
|
+
}),
|
|
226
|
+
// 2. Validate it's a valid number
|
|
227
|
+
v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })),
|
|
228
|
+
// 3. Validate range
|
|
229
|
+
v.minValue(min, m.v_atLeast({ min }, { locale })), v.maxValue(max, m.v_atMost({ max }, { locale })),
|
|
230
|
+
// 4. Validate decimal precision
|
|
231
|
+
v.check((value) => {
|
|
232
|
+
const shifted = value * 10 ** fractionDigits;
|
|
233
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
234
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })),
|
|
235
|
+
// 5. Format
|
|
236
|
+
v.transform((value) => value.toFixed(fractionDigits)), v.string());
|
|
237
|
+
}
|
|
238
|
+
export function numberStringFixedEmptyNullMinimum(fractionDigits, min, locale) {
|
|
239
|
+
if (typeof min === 'string')
|
|
240
|
+
min = Number(min);
|
|
241
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
242
|
+
// 1. Normalize early (so we can validate consistently)
|
|
243
|
+
v.transform((value) => {
|
|
244
|
+
if (typeof value === 'number')
|
|
245
|
+
return value;
|
|
246
|
+
const trimmed = value.trim();
|
|
247
|
+
if (trimmed === '')
|
|
248
|
+
return null;
|
|
249
|
+
return Number(trimmed);
|
|
250
|
+
}), v.union([
|
|
251
|
+
v.null(),
|
|
252
|
+
v.pipe(v.number(), v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })), v.minValue(min, m.v_atLeast({ min }, { locale })), v.check((value) => {
|
|
253
|
+
const shifted = value * 10 ** fractionDigits;
|
|
254
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
255
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })), v.transform((value) => value.toFixed(fractionDigits)), v.string()),
|
|
256
|
+
]));
|
|
257
|
+
}
|
|
258
|
+
export function numberStringFixedEmptyNullMaximum(fractionDigits, max, locale) {
|
|
259
|
+
if (typeof max === 'string')
|
|
260
|
+
max = Number(max);
|
|
261
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
262
|
+
// 1. Normalize early (so we can validate consistently)
|
|
263
|
+
v.transform((value) => {
|
|
264
|
+
if (typeof value === 'number')
|
|
265
|
+
return value;
|
|
266
|
+
const trimmed = value.trim();
|
|
267
|
+
if (trimmed === '')
|
|
268
|
+
return null;
|
|
269
|
+
return Number(trimmed);
|
|
270
|
+
}), v.union([
|
|
271
|
+
v.null(),
|
|
272
|
+
v.pipe(v.number(), v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })), v.maxValue(max, m.v_atMost({ max }, { locale })), v.check((value) => {
|
|
273
|
+
const shifted = value * 10 ** fractionDigits;
|
|
274
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
275
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })), v.transform((value) => value.toFixed(fractionDigits)), v.string()),
|
|
276
|
+
]));
|
|
277
|
+
}
|
|
278
|
+
export function numberStringFixedEmptyNullRange(fractionDigits, min, max, locale) {
|
|
279
|
+
if (typeof min === 'string')
|
|
280
|
+
min = Number(min);
|
|
281
|
+
if (typeof max === 'string')
|
|
282
|
+
max = Number(max);
|
|
283
|
+
return v.pipe(v.union([v.number(), v.string()]),
|
|
284
|
+
// 1. Normalize early (so we can validate consistently)
|
|
285
|
+
v.transform((value) => {
|
|
286
|
+
if (typeof value === 'number')
|
|
287
|
+
return value;
|
|
288
|
+
const trimmed = value.trim();
|
|
289
|
+
if (trimmed === '')
|
|
290
|
+
return null;
|
|
291
|
+
return Number(trimmed);
|
|
292
|
+
}), v.union([
|
|
293
|
+
v.null(),
|
|
294
|
+
v.pipe(v.number(), v.check((value) => Number.isFinite(value), m.v_NaN({}, { locale })), v.minValue(min, m.v_atLeast({ min }, { locale })), v.maxValue(max, m.v_atMost({ max }, { locale })), v.check((value) => {
|
|
295
|
+
const shifted = value * 10 ** fractionDigits;
|
|
296
|
+
return Math.abs(shifted - Math.trunc(shifted)) < Number.EPSILON;
|
|
297
|
+
}, m.v_overPrecision({ fractionDigits }, { locale })), v.transform((value) => value.toFixed(fractionDigits)), v.string()),
|
|
298
|
+
]));
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=number-string.js.map
|