@nhtio/encoder 0.1.0-master-3b237666 → 0.1.0-master-f44af99f
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/{exceptions-CkrSQ6oY.mjs → exceptions-C8bYu-xi.mjs} +2 -2
- package/{exceptions-CkrSQ6oY.mjs.map → exceptions-C8bYu-xi.mjs.map} +1 -1
- package/{exceptions-DYhBvDYC.js → exceptions-DiuSuXH-.js} +2 -2
- package/{exceptions-DYhBvDYC.js.map → exceptions-DiuSuXH-.js.map} +1 -1
- package/exceptions.cjs +1 -1
- package/exceptions.mjs +1 -1
- package/function_serializer.cjs +1 -1
- package/function_serializer.mjs +1 -1
- package/index.cjs +52 -25
- package/index.cjs.map +1 -1
- package/index.mjs +52 -25
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/{type_guards-Nh3b7rEF.js → type_guards-BWmHnIpZ.js} +23 -5
- package/{type_guards-Nh3b7rEF.js.map → type_guards-BWmHnIpZ.js.map} +1 -1
- package/{type_guards-BbzVmysZ.mjs → type_guards-UkDoe__i.mjs} +29 -11
- package/{type_guards-BbzVmysZ.mjs.map → type_guards-UkDoe__i.mjs.map} +1 -1
- package/type_guards.cjs +1 -1
- package/type_guards.mjs +5 -5
package/package.json
CHANGED
|
@@ -123859,7 +123859,13 @@ const stringSchema = validator.string().allow("").required();
|
|
|
123859
123859
|
const numberSchema = validator.alternatives(
|
|
123860
123860
|
validator.number(),
|
|
123861
123861
|
validator.object().instance(Number),
|
|
123862
|
-
validator.function().instance(Number)
|
|
123862
|
+
validator.function().instance(Number),
|
|
123863
|
+
validator.valid(
|
|
123864
|
+
Number.MAX_SAFE_INTEGER,
|
|
123865
|
+
Number.MIN_SAFE_INTEGER,
|
|
123866
|
+
Number.MAX_VALUE,
|
|
123867
|
+
Number.MIN_VALUE
|
|
123868
|
+
)
|
|
123863
123869
|
).required();
|
|
123864
123870
|
const booleanSchema = validator.boolean().required();
|
|
123865
123871
|
const bigintSchema = validator.any().custom((value, helpers) => {
|
|
@@ -123997,7 +124003,7 @@ const phoneObjectSchema = validator.alternatives(
|
|
|
123997
124003
|
return value;
|
|
123998
124004
|
}
|
|
123999
124005
|
return helpers.error("any.invalid");
|
|
124000
|
-
}),
|
|
124006
|
+
}).required(),
|
|
124001
124007
|
validator.object({
|
|
124002
124008
|
country: validator.string().required().valid(...[...Array.from(isos), "XX"]),
|
|
124003
124009
|
international: validator.string().allow("").required(),
|
|
@@ -124008,8 +124014,8 @@ const phoneObjectSchema = validator.alternatives(
|
|
|
124008
124014
|
timezone: validator.string().required(),
|
|
124009
124015
|
type: validator.string().valid(...Array.from(PhoneTypes)).required(),
|
|
124010
124016
|
valid: validator.boolean().required()
|
|
124011
|
-
}).unknown(true)
|
|
124012
|
-
);
|
|
124017
|
+
}).unknown(true).required()
|
|
124018
|
+
).required();
|
|
124013
124019
|
const isObject$1 = (value) => {
|
|
124014
124020
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
124015
124021
|
};
|
|
@@ -124063,6 +124069,15 @@ const isNegativeZero = (value) => {
|
|
|
124063
124069
|
if (!isNumber(value)) return false;
|
|
124064
124070
|
return 1 / value < 0 && Math.abs(value) === 0;
|
|
124065
124071
|
};
|
|
124072
|
+
const isPositiveInfinity = (value) => {
|
|
124073
|
+
return typeof value === "number" && !Number.isNaN(value) && !Number.isFinite(value) && value > 0;
|
|
124074
|
+
};
|
|
124075
|
+
const isNegativeInfinity = (value) => {
|
|
124076
|
+
return typeof value === "number" && !Number.isNaN(value) && !Number.isFinite(value) && value < 0;
|
|
124077
|
+
};
|
|
124078
|
+
const isUnsafeInteger = (value) => {
|
|
124079
|
+
return Number.isInteger(value) && !Number.isSafeInteger(value);
|
|
124080
|
+
};
|
|
124066
124081
|
const matchesSchema = (value, schema) => {
|
|
124067
124082
|
const { error } = schema.validate(value, {
|
|
124068
124083
|
abortEarly: true
|
|
@@ -124108,12 +124123,15 @@ exports.isLuxonDuration = isLuxonDuration;
|
|
|
124108
124123
|
exports.isLuxonInterval = isLuxonInterval;
|
|
124109
124124
|
exports.isLuxonSystemZone = isLuxonSystemZone;
|
|
124110
124125
|
exports.isMap = isMap;
|
|
124126
|
+
exports.isNegativeInfinity = isNegativeInfinity;
|
|
124111
124127
|
exports.isNegativeZero = isNegativeZero;
|
|
124112
124128
|
exports.isNumber = isNumber;
|
|
124113
124129
|
exports.isObject = isObject$1;
|
|
124114
124130
|
exports.isPhoneObject = isPhoneObject;
|
|
124131
|
+
exports.isPositiveInfinity = isPositiveInfinity;
|
|
124115
124132
|
exports.isPrimitive = isPrimitive;
|
|
124116
124133
|
exports.isSet = isSet;
|
|
124117
124134
|
exports.isTypedArray = isTypedArray;
|
|
124118
124135
|
exports.isUniterableObject = isUniterableObject;
|
|
124119
|
-
|
|
124136
|
+
exports.isUnsafeInteger = isUnsafeInteger;
|
|
124137
|
+
//# sourceMappingURL=type_guards-BWmHnIpZ.js.map
|