@nhtio/encoder 0.1.0-master-9b97505f → 0.1.0-master-cf69c10e
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-P-gXm8Io.mjs → exceptions-B6LwiRSz.mjs} +2 -2
- package/{exceptions-P-gXm8Io.mjs.map → exceptions-B6LwiRSz.mjs.map} +1 -1
- package/{exceptions-vnhPQaJe.js → exceptions-CvP1Ipcx.js} +2 -2
- package/{exceptions-vnhPQaJe.js.map → exceptions-CvP1Ipcx.js.map} +1 -1
- package/exceptions.cjs +1 -1
- package/exceptions.mjs +1 -1
- package/index.cjs +6 -8
- package/index.cjs.map +1 -1
- package/index.mjs +7 -9
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as isObject, a as isArray, b as isSet, c as isMap, d as isLuxonSystemZone, e as isLuxonInterval, f as isLuxonDuration, g as isLuxonDateTime,
|
|
1
|
+
import { i as isObject, a as isArray, b as isSet, c as isMap, d as isLuxonSystemZone, e as isLuxonInterval, f as isLuxonDuration, g as isLuxonDateTime, h as isPhoneObject, j as isTypedArray, k as isBigIntTypedArray, l as isPrimitive, m as isUniterableObject, n as isError, o as isBigInt, p as isUnsafeInteger, q as isNegativeInfinity, r as isPositiveInfinity, s as isNegativeZero, I as Info, t as Interval, D as DateTime, u as Duration, P as Phone } from "./type_guards-UkDoe__i.mjs";
|
|
2
2
|
import { FunctionSerializer } from "./function_serializer.mjs";
|
|
3
|
-
import { E as E_UNENCODABLE_VALUE, a as E_CIRCULAR_REFERENCE, b as E_ENCODING_FAILED, B as BaseException, c as E_UNDECODABLE_VALUE, d as E_NOT_AN_ENCODED_VALUE, e as E_INVALID_VERSION, f as E_INCOMPATIBLE_VERSION } from "./exceptions-
|
|
3
|
+
import { E as E_UNENCODABLE_VALUE, a as E_CIRCULAR_REFERENCE, b as E_ENCODING_FAILED, B as BaseException, c as E_UNDECODABLE_VALUE, d as E_NOT_AN_ENCODED_VALUE, e as E_INVALID_VERSION, f as E_INCOMPATIBLE_VERSION } from "./exceptions-B6LwiRSz.mjs";
|
|
4
4
|
var re = { exports: {} };
|
|
5
5
|
var constants;
|
|
6
6
|
var hasRequiredConstants;
|
|
@@ -3025,9 +3025,7 @@ const toStructuredData = (value, seen = /* @__PURE__ */ new WeakSet()) => {
|
|
|
3025
3025
|
throw new E_CIRCULAR_REFERENCE();
|
|
3026
3026
|
}
|
|
3027
3027
|
seen.add(value);
|
|
3028
|
-
const dto = value
|
|
3029
|
-
value.loc.locale
|
|
3030
|
-
);
|
|
3028
|
+
const dto = value;
|
|
3031
3029
|
return {
|
|
3032
3030
|
_t: "luxon:DateTime",
|
|
3033
3031
|
_s: toStructuredData(
|
|
@@ -3270,11 +3268,11 @@ const { parse: $parse, stringify: $stringify } = JSON;
|
|
|
3270
3268
|
const options = { json: true, lossy: true };
|
|
3271
3269
|
const parse = (str) => deserialize($parse(str));
|
|
3272
3270
|
const stringify = (any) => $stringify(serialize(any, options));
|
|
3273
|
-
const version = "0.1.0-master-
|
|
3271
|
+
const version = "0.1.0-master-cf69c10e";
|
|
3274
3272
|
const encode = (what) => {
|
|
3275
3273
|
const structured = toStructuredData(what);
|
|
3276
3274
|
const serialized = serialize(structured, { lossy: true, json: true });
|
|
3277
|
-
const json = stringify({ version: "0.1.0-master-
|
|
3275
|
+
const json = stringify({ version: "0.1.0-master-cf69c10e", serialized });
|
|
3278
3276
|
return utoa(json);
|
|
3279
3277
|
};
|
|
3280
3278
|
const decode = (base64) => {
|
|
@@ -3285,11 +3283,11 @@ const decode = (base64) => {
|
|
|
3285
3283
|
throw new E_NOT_AN_ENCODED_VALUE(base64);
|
|
3286
3284
|
}
|
|
3287
3285
|
const { version: payloadVersion, serialized } = parsed;
|
|
3288
|
-
if (semverExports.valid("0.1.0-master-
|
|
3286
|
+
if (semverExports.valid("0.1.0-master-cf69c10e")) {
|
|
3289
3287
|
if (!semverExports.valid(semverExports.coerce(payloadVersion))) {
|
|
3290
3288
|
throw new E_INVALID_VERSION(payloadVersion);
|
|
3291
3289
|
}
|
|
3292
|
-
if (semverExports.gt(semverExports.coerce(payloadVersion), "0.1.0-master-
|
|
3290
|
+
if (semverExports.gt(semverExports.coerce(payloadVersion), "0.1.0-master-cf69c10e")) {
|
|
3293
3291
|
throw new E_INCOMPATIBLE_VERSION(payloadVersion);
|
|
3294
3292
|
}
|
|
3295
3293
|
}
|