@nhtio/encoder 0.1.0-master-cf69c10e → 0.1.0-master-492fadb0
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-CvP1Ipcx.js → exceptions-BfKyCF4p.js} +2 -2
- package/{exceptions-CvP1Ipcx.js.map → exceptions-BfKyCF4p.js.map} +1 -1
- package/{exceptions-B6LwiRSz.mjs → exceptions-MW3dkAUt.mjs} +2 -2
- package/{exceptions-B6LwiRSz.mjs.map → exceptions-MW3dkAUt.mjs.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 +64 -7
- package/index.cjs.map +1 -1
- package/index.d.ts +32 -1
- package/index.mjs +64 -7
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/{type_guards-UkDoe__i.mjs → type_guards-BAhiOypL.mjs} +37 -25
- package/{type_guards-UkDoe__i.mjs.map → type_guards-BAhiOypL.mjs.map} +1 -1
- package/{type_guards-BWmHnIpZ.js → type_guards-D1YzZ13G.js} +13 -1
- package/{type_guards-BWmHnIpZ.js.map → type_guards-D1YzZ13G.js.map} +1 -1
- package/type_guards.cjs +2 -1
- package/type_guards.cjs.map +1 -1
- package/type_guards.d.ts +39 -0
- package/type_guards.mjs +20 -19
- package/types.d.ts +15 -1
|
@@ -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-
|
|
124149
|
+
//# sourceMappingURL=type_guards-D1YzZ13G.js.map
|