@sinclair/typebox 0.33.11 → 0.33.12
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.
|
@@ -66,7 +66,8 @@ function TryConvertBoolean(value) {
|
|
|
66
66
|
return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value;
|
|
67
67
|
}
|
|
68
68
|
function TryConvertBigInt(value) {
|
|
69
|
-
|
|
69
|
+
const truncateInteger = (value) => value.split('.')[0];
|
|
70
|
+
return IsStringNumeric(value) ? BigInt(truncateInteger(value)) : (0, index_5.IsNumber)(value) ? BigInt(value | 0) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value;
|
|
70
71
|
}
|
|
71
72
|
function TryConvertString(value) {
|
|
72
73
|
return IsValueToString(value) ? value.toString() : (0, index_5.IsSymbol)(value) && value.description !== undefined ? value.description.toString() : value;
|
|
@@ -62,7 +62,8 @@ function TryConvertBoolean(value) {
|
|
|
62
62
|
return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value;
|
|
63
63
|
}
|
|
64
64
|
function TryConvertBigInt(value) {
|
|
65
|
-
|
|
65
|
+
const truncateInteger = (value) => value.split('.')[0];
|
|
66
|
+
return IsStringNumeric(value) ? BigInt(truncateInteger(value)) : IsNumber(value) ? BigInt(value | 0) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value;
|
|
66
67
|
}
|
|
67
68
|
function TryConvertString(value) {
|
|
68
69
|
return IsValueToString(value) ? value.toString() : IsSymbol(value) && value.description !== undefined ? value.description.toString() : value;
|