@sinclair/typebox 0.34.14 → 0.34.15
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.
|
@@ -76,7 +76,7 @@ function TryConvertNumber(value) {
|
|
|
76
76
|
return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
|
|
77
77
|
}
|
|
78
78
|
function TryConvertInteger(value) {
|
|
79
|
-
return IsStringNumeric(value) ? parseInt(value) : (0, index_5.IsNumber)(value) ? value
|
|
79
|
+
return IsStringNumeric(value) ? parseInt(value) : (0, index_5.IsNumber)(value) ? Math.trunc(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
|
|
80
80
|
}
|
|
81
81
|
function TryConvertNull(value) {
|
|
82
82
|
return (0, index_5.IsString)(value) && value.toLowerCase() === 'null' ? null : value;
|
|
@@ -72,7 +72,7 @@ function TryConvertNumber(value) {
|
|
|
72
72
|
return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
|
|
73
73
|
}
|
|
74
74
|
function TryConvertInteger(value) {
|
|
75
|
-
return IsStringNumeric(value) ? parseInt(value) : IsNumber(value) ? value
|
|
75
|
+
return IsStringNumeric(value) ? parseInt(value) : IsNumber(value) ? Math.trunc(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
|
|
76
76
|
}
|
|
77
77
|
function TryConvertNull(value) {
|
|
78
78
|
return IsString(value) && value.toLowerCase() === 'null' ? null : value;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1779,7 +1779,6 @@ The following is a list of community packages that offer general tooling, extend
|
|
|
1779
1779
|
| [sveltekit-superforms](https://github.com/ciscoheat/sveltekit-superforms) | A comprehensive SvelteKit form library for server and client validation |
|
|
1780
1780
|
| [ts2typebox](https://github.com/xddq/ts2typebox) | Creating TypeBox code from Typescript types |
|
|
1781
1781
|
| [typebox-form-parser](https://github.com/jtlapp/typebox-form-parser) | Parses form and query data based on TypeBox schemas |
|
|
1782
|
-
| [typebox-validators](https://github.com/jtlapp/typebox-validators) | Advanced validators supporting discriminated and heterogeneous unions |
|
|
1783
1782
|
|
|
1784
1783
|
<a name='benchmark'></a>
|
|
1785
1784
|
|