@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nhtio/encoder",
3
- "version": "0.1.0-master-3b237666",
3
+ "version": "0.1.0-master-f44af99f",
4
4
  "description": "A portable cross-environment encoder / decoder for complex and structured data",
5
5
  "keywords": [],
6
6
  "author": "Jak Giveon <jak@nht.io>",
@@ -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
- //# sourceMappingURL=type_guards-Nh3b7rEF.js.map
124136
+ exports.isUnsafeInteger = isUnsafeInteger;
124137
+ //# sourceMappingURL=type_guards-BWmHnIpZ.js.map