@nhtio/encoder 1.20260611.0 → 1.20260624.0

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.
@@ -6483,6 +6483,8 @@ function friendlyDateTime$1(dateTimeish) {
6483
6483
  );
6484
6484
  }
6485
6485
  }
6486
+ const ENCODE_METHOD = Symbol.for("@nhtio/encoder:toEncoded");
6487
+ const DECODE_METHOD = Symbol.for("@nhtio/encoder:fromEncoded");
6486
6488
  var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __esmMin = (fn$1, res) => () => (fn$1 && (res = fn$1(fn$1 = 0)), res), __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), __export = (target, all$1) => {
6487
6489
  for (var name$2 in all$1) __defProp(target, name$2, { get: all$1[name$2], enumerable: true });
6488
6490
  }, __copyProps = (to, from$2, except, desc$1) => {
@@ -124108,13 +124110,23 @@ const isLuxonSystemZone = (value) => {
124108
124110
  const isBigInt = (value) => {
124109
124111
  return matchesSchema(value, bigintSchema);
124110
124112
  };
124113
+ const isCustomEncodable = (value) => {
124114
+ if (typeof value !== "object" || value === null) return false;
124115
+ if (!(ENCODE_METHOD in value) || typeof value[ENCODE_METHOD] !== "function") return false;
124116
+ const ctor = value.constructor;
124117
+ if (typeof ctor !== "function" || typeof ctor.name !== "string" || ctor.name === "") return false;
124118
+ return DECODE_METHOD in ctor && typeof ctor[DECODE_METHOD] === "function";
124119
+ };
124120
+ exports.DECODE_METHOD = DECODE_METHOD;
124111
124121
  exports.DateTime = DateTime$1;
124112
124122
  exports.Duration = Duration$1;
124123
+ exports.ENCODE_METHOD = ENCODE_METHOD;
124113
124124
  exports.Info = Info$1;
124114
124125
  exports.Interval = Interval$1;
124115
124126
  exports.isArray = isArray;
124116
124127
  exports.isBigInt = isBigInt;
124117
124128
  exports.isBigIntTypedArray = isBigIntTypedArray;
124129
+ exports.isCustomEncodable = isCustomEncodable;
124118
124130
  exports.isError = isError;
124119
124131
  exports.isInstanceOf = isInstanceOf;
124120
124132
  exports.isLucidBinaryValue = isLucidBinaryValue;
@@ -124134,4 +124146,4 @@ exports.isSet = isSet;
124134
124146
  exports.isTypedArray = isTypedArray;
124135
124147
  exports.isUniterableObject = isUniterableObject;
124136
124148
  exports.isUnsafeInteger = isUnsafeInteger;
124137
- //# sourceMappingURL=type_guards-BWmHnIpZ.js.map
124149
+ //# sourceMappingURL=type_guards-D1YzZ13G.js.map