@cbortech/cbor 0.25.11 → 0.26.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.
- package/README.ja.md +75 -21
- package/README.md +74 -22
- package/assets/cbor-cdn-js.png +0 -0
- package/dist/ast/index.cjs +1 -1
- package/dist/ast/index.js +2 -2
- package/dist/cdn/index.cjs +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/tokenizer.d.ts +8 -5
- package/dist/extensions/concat.d.ts +5 -0
- package/dist/extensions/ilstrings.d.ts +5 -0
- package/dist/index.cjs +6 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +147 -308
- package/dist/index.js.map +1 -1
- package/dist/{mapEntries-CYvdsAfP.js → mapEntries-BdzS6bFp.js} +332 -42
- package/dist/mapEntries-BdzS6bFp.js.map +1 -0
- package/dist/{mapEntries-vOYb5Q1s.cjs → mapEntries-DJtvWpWq.cjs} +7 -4
- package/dist/mapEntries-DJtvWpWq.cjs.map +1 -0
- package/dist/{tokenizer-DkLlZ1gc.js → tokenizer-CeuixxXi.js} +20 -19
- package/dist/tokenizer-CeuixxXi.js.map +1 -0
- package/dist/{tokenizer-CVcIyZZa.cjs → tokenizer-EciPlN0n.cjs} +3 -3
- package/dist/tokenizer-EciPlN0n.cjs.map +1 -0
- package/package.json +3 -2
- package/dist/mapEntries-CYvdsAfP.js.map +0 -1
- package/dist/mapEntries-vOYb5Q1s.cjs.map +0 -1
- package/dist/tokenizer-CVcIyZZa.cjs.map +0 -1
- package/dist/tokenizer-DkLlZ1gc.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "./tokenizer-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./tokenizer-CeuixxXi.js";
|
|
2
2
|
//#region src/tag.ts
|
|
3
3
|
var o = Symbol.for("cbor.tag"), s = class {
|
|
4
4
|
valueOf() {
|
|
@@ -1222,7 +1222,6 @@ function pt(e) {
|
|
|
1222
1222
|
var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'extensions' option (extensions: [${e}])`, ht = (e, t) => `install ${t}, import { ${e} } from '${t}', and pass it via the 'extensions' option (extensions: [${e}])`, gt = /* @__PURE__ */ new Map([
|
|
1223
1223
|
["b32", mt("b32")],
|
|
1224
1224
|
["h32", mt("h32")],
|
|
1225
|
-
["float", mt("float")],
|
|
1226
1225
|
["same", mt("same")],
|
|
1227
1226
|
["hash", ht("hash", "@cbortech/hash-extension")],
|
|
1228
1227
|
["uuid", ht("uuid", "@cbortech/uuid-extension")],
|
|
@@ -1237,7 +1236,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
|
|
|
1237
1236
|
_hintedPrefixes = /* @__PURE__ */ new Set();
|
|
1238
1237
|
constructor(e, t) {
|
|
1239
1238
|
this.t = e, this._options = t, this.extByPrefix = /* @__PURE__ */ new Map(), this.extByTag = /* @__PURE__ */ new Map(), this.unresolvedExtension = t.unresolvedExtension ?? "cpa999";
|
|
1240
|
-
for (let e of [...
|
|
1239
|
+
for (let e of [...Fr, ...t.extensions ?? []]) {
|
|
1241
1240
|
for (let t of e.appStringPrefixes ?? []) this.extByPrefix.set(t, e);
|
|
1242
1241
|
for (let t of e.tagNumbers ?? []) this.extByTag.set(t, e);
|
|
1243
1242
|
}
|
|
@@ -2588,7 +2587,7 @@ function Kn(e) {
|
|
|
2588
2587
|
}
|
|
2589
2588
|
var qn = Array.from({ length: 24 }, (e, t) => BigInt(t)), Jn;
|
|
2590
2589
|
function Yn() {
|
|
2591
|
-
return Jn ??=
|
|
2590
|
+
return Jn ??= Fr.filter((e) => e.parseTag !== void 0);
|
|
2592
2591
|
}
|
|
2593
2592
|
function Xn(e, t) {
|
|
2594
2593
|
for (let n = 0; n < t; n++) if (e[n] >= 128) return;
|
|
@@ -2898,49 +2897,340 @@ function ir(e, t) {
|
|
|
2898
2897
|
}
|
|
2899
2898
|
//#endregion
|
|
2900
2899
|
//#region src/extensions/cbordata.ts
|
|
2901
|
-
var ar = 24n,
|
|
2900
|
+
var ar = 24n, or = {
|
|
2901
|
+
tagNumbers: [ar],
|
|
2902
|
+
parseTag(e, t, n) {
|
|
2903
|
+
if (e !== 24n || !(t instanceof N)) return;
|
|
2904
|
+
let r = n ? {
|
|
2905
|
+
extensions: n.extensions,
|
|
2906
|
+
strict: n.strict,
|
|
2907
|
+
onWarning: n.onWarning,
|
|
2908
|
+
silent: n.silent
|
|
2909
|
+
} : void 0;
|
|
2910
|
+
try {
|
|
2911
|
+
return new M(ar, new Ue([ir(t.value, r)], { encodingWidth: t.encodingWidth }));
|
|
2912
|
+
} catch (e) {
|
|
2913
|
+
if (r?.strict !== !1) throw e;
|
|
2914
|
+
return;
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
}, sr = new TextEncoder(), cr = new TextDecoder("utf-8", { fatal: !0 }), lr = new TextDecoder("utf-8", { fatal: !1 }), ur = Symbol("ellipsis");
|
|
2918
|
+
function dr(e) {
|
|
2919
|
+
let t = 0;
|
|
2920
|
+
for (let n of e) t += n.length;
|
|
2921
|
+
let n = new Uint8Array(t), r = 0;
|
|
2922
|
+
for (let t of e) n.set(t, r), r += t.length;
|
|
2923
|
+
return n;
|
|
2924
|
+
}
|
|
2925
|
+
function fr(e, t, n) {
|
|
2926
|
+
if (t instanceof Ke) {
|
|
2927
|
+
fr(e, t.inner, n);
|
|
2928
|
+
return;
|
|
2929
|
+
}
|
|
2930
|
+
if (t instanceof z) {
|
|
2931
|
+
if (t.content instanceof I) for (let r of t.content.items) fr(e, r, n);
|
|
2932
|
+
else n.push(ur);
|
|
2933
|
+
return;
|
|
2934
|
+
}
|
|
2935
|
+
if (t instanceof B) {
|
|
2936
|
+
n.push(sr.encode(t.value));
|
|
2937
|
+
return;
|
|
2938
|
+
}
|
|
2939
|
+
if (t instanceof N) {
|
|
2940
|
+
n.push(t.value);
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
if (t instanceof F) {
|
|
2944
|
+
n.push(sr.encode(t.chunks.map((e) => e.value).join("")));
|
|
2945
|
+
return;
|
|
2946
|
+
}
|
|
2947
|
+
if (t instanceof P) {
|
|
2948
|
+
n.push(dr(t.chunks.map((e) => e.value)));
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2951
|
+
throw SyntaxError(`${e}<<...>> arguments must be (text or byte) strings or ellipses`);
|
|
2952
|
+
}
|
|
2953
|
+
function pr(e, t) {
|
|
2954
|
+
try {
|
|
2955
|
+
return cr.decode(e);
|
|
2956
|
+
} catch {
|
|
2957
|
+
let n = "t1 concatenation result is not valid UTF-8";
|
|
2958
|
+
if (t) t(n);
|
|
2959
|
+
else throw SyntaxError(n);
|
|
2960
|
+
return lr.decode(e);
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
function mr(e, t, n) {
|
|
2964
|
+
let r = [];
|
|
2965
|
+
for (let n of t) fr(e, n, r);
|
|
2966
|
+
let i = e === "t1", a = [], o = !1, s = [], c = () => {
|
|
2967
|
+
if (s.length === 0) return;
|
|
2968
|
+
let e = dr(s);
|
|
2969
|
+
s.length = 0, e.length !== 0 && a.push(i ? new B(pr(e, n)) : new N(e));
|
|
2970
|
+
};
|
|
2971
|
+
for (let e of r) e === ur ? (c(), a[a.length - 1] instanceof z || (a.push(new z()), o = !0)) : s.push(e);
|
|
2972
|
+
if (!o) {
|
|
2973
|
+
let e = dr(s);
|
|
2974
|
+
return i ? new B(pr(e, n)) : new N(e);
|
|
2975
|
+
}
|
|
2976
|
+
return c(), a.length === 1 ? new z() : new z(a);
|
|
2977
|
+
}
|
|
2978
|
+
function hr(e) {
|
|
2979
|
+
return {
|
|
2980
|
+
appStringPrefixes: [e],
|
|
2981
|
+
preserveAppSeqSource: !0,
|
|
2982
|
+
parseAppString(t, n, r) {
|
|
2983
|
+
return mr(e, [new B(n)], r);
|
|
2984
|
+
},
|
|
2985
|
+
parseAppSequence(t, n, r) {
|
|
2986
|
+
return mr(e, n, r);
|
|
2987
|
+
}
|
|
2988
|
+
};
|
|
2989
|
+
}
|
|
2990
|
+
var gr = hr("t1"), _r = hr("b1"), vr = new TextEncoder(), yr = new TextDecoder("utf-8", { fatal: !0 }), br = new TextDecoder("utf-8", { fatal: !1 });
|
|
2991
|
+
function xr(e) {
|
|
2992
|
+
let t = 0;
|
|
2993
|
+
for (let n of e) t += n.length;
|
|
2994
|
+
let n = new Uint8Array(t), r = 0;
|
|
2995
|
+
for (let t of e) n.set(t, r), r += t.length;
|
|
2996
|
+
return n;
|
|
2997
|
+
}
|
|
2998
|
+
function Sr(e, t, n) {
|
|
2999
|
+
let r = e === "ilts", i = [], a = [];
|
|
3000
|
+
for (let o of t) {
|
|
3001
|
+
if (o instanceof Ke && (o = o.inner), o instanceof z) throw SyntaxError(`${e}<<...>> cannot contain ellipses; there is no way to include an elision in an indefinite-length string`);
|
|
3002
|
+
let t, s, c;
|
|
3003
|
+
if (o instanceof B) t = o.value, c = o.encodingWidth;
|
|
3004
|
+
else if (o instanceof N) s = o.value, c = o.encodingWidth;
|
|
3005
|
+
else if (o instanceof F) t = o.chunks.map((e) => e.value).join("");
|
|
3006
|
+
else if (o instanceof P) s = xr(o.chunks.map((e) => e.value));
|
|
3007
|
+
else throw SyntaxError(`${e}<<...>> arguments must be (text or byte) strings`);
|
|
3008
|
+
if (r) {
|
|
3009
|
+
let e;
|
|
3010
|
+
if (t !== void 0) e = t;
|
|
3011
|
+
else try {
|
|
3012
|
+
e = yr.decode(s);
|
|
3013
|
+
} catch {
|
|
3014
|
+
let t = "ilts chunk is not valid UTF-8";
|
|
3015
|
+
if (n) n(t);
|
|
3016
|
+
else throw SyntaxError(t);
|
|
3017
|
+
e = br.decode(s);
|
|
3018
|
+
}
|
|
3019
|
+
a.push(new B(e, c === void 0 ? void 0 : { encodingWidth: c }));
|
|
3020
|
+
} else {
|
|
3021
|
+
let e = s ?? vr.encode(t);
|
|
3022
|
+
i.push(new N(e, c === void 0 ? void 0 : { encodingWidth: c }));
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
return r ? new F(a) : new P(i);
|
|
3026
|
+
}
|
|
3027
|
+
function Cr(e) {
|
|
3028
|
+
return {
|
|
3029
|
+
appStringPrefixes: [e],
|
|
3030
|
+
preserveAppSeqSource: !0,
|
|
3031
|
+
parseAppString(t, n, r) {
|
|
3032
|
+
return new Ke(Sr(e, [new B(n)], r), `${e}${xe(n)}`);
|
|
3033
|
+
},
|
|
3034
|
+
parseAppSequence(t, n, r) {
|
|
3035
|
+
return Sr(e, n, r);
|
|
3036
|
+
}
|
|
3037
|
+
};
|
|
3038
|
+
}
|
|
3039
|
+
var wr = Cr("ilbs"), Tr = Cr("ilts");
|
|
3040
|
+
//#endregion
|
|
3041
|
+
//#region src/utils/strip-comments.ts
|
|
3042
|
+
function Er(e) {
|
|
3043
|
+
let t = "", n = 0;
|
|
3044
|
+
for (; n < e.length;) {
|
|
3045
|
+
let r = e[n];
|
|
3046
|
+
if (r === " " || r === "\n" || r === "\r") {
|
|
3047
|
+
n++;
|
|
3048
|
+
continue;
|
|
3049
|
+
}
|
|
3050
|
+
if (r === "#") {
|
|
3051
|
+
for (; n < e.length && e[n] !== "\n";) n++;
|
|
3052
|
+
continue;
|
|
3053
|
+
}
|
|
3054
|
+
if (r === "/") {
|
|
3055
|
+
let t = e[n + 1] ?? "";
|
|
3056
|
+
if (t === "/") {
|
|
3057
|
+
for (; n < e.length && e[n] !== "\n";) n++;
|
|
3058
|
+
continue;
|
|
3059
|
+
}
|
|
3060
|
+
if (t === "*") {
|
|
3061
|
+
for (n += 2; n < e.length && !(e[n] === "*" && (e[n + 1] ?? "") === "/");) n++;
|
|
3062
|
+
if (n >= e.length) throw SyntaxError("unterminated block comment");
|
|
3063
|
+
n += 2;
|
|
3064
|
+
continue;
|
|
3065
|
+
}
|
|
3066
|
+
for (n++; n < e.length && e[n] !== "/";) n++;
|
|
3067
|
+
if (n >= e.length) throw SyntaxError("unterminated block comment");
|
|
3068
|
+
n++;
|
|
3069
|
+
continue;
|
|
3070
|
+
}
|
|
3071
|
+
t += r, n++;
|
|
3072
|
+
}
|
|
3073
|
+
return t;
|
|
3074
|
+
}
|
|
3075
|
+
//#endregion
|
|
3076
|
+
//#region src/extensions/float.ts
|
|
3077
|
+
var Dr = class extends j {
|
|
3078
|
+
_bits;
|
|
3079
|
+
constructor(e) {
|
|
3080
|
+
super(C(e), { precision: "half" }), this._bits = e & 65535;
|
|
3081
|
+
}
|
|
3082
|
+
_toCBOR() {
|
|
3083
|
+
return new Uint8Array([
|
|
3084
|
+
249,
|
|
3085
|
+
this._bits >> 8 & 255,
|
|
3086
|
+
this._bits & 255
|
|
3087
|
+
]);
|
|
3088
|
+
}
|
|
3089
|
+
}, Or = class extends j {
|
|
3090
|
+
_raw;
|
|
3091
|
+
constructor(e) {
|
|
3092
|
+
super(new DataView(e.buffer, e.byteOffset).getFloat32(0, !1), { precision: "single" }), this._raw = e.slice();
|
|
3093
|
+
}
|
|
3094
|
+
_toCBOR() {
|
|
3095
|
+
let e = /* @__PURE__ */ new Uint8Array(5);
|
|
3096
|
+
return e[0] = 250, e.set(this._raw, 1), e;
|
|
3097
|
+
}
|
|
3098
|
+
}, kr = class extends j {
|
|
3099
|
+
_raw;
|
|
3100
|
+
constructor(e) {
|
|
3101
|
+
super(new DataView(e.buffer, e.byteOffset).getFloat64(0, !1), { precision: "double" }), this._raw = e.slice();
|
|
3102
|
+
}
|
|
3103
|
+
_toCBOR() {
|
|
3104
|
+
let e = /* @__PURE__ */ new Uint8Array(9);
|
|
3105
|
+
return e[0] = 251, e.set(this._raw, 1), e;
|
|
3106
|
+
}
|
|
3107
|
+
};
|
|
3108
|
+
function Z(e) {
|
|
3109
|
+
if (e.length === 2) return new Dr(e[0] << 8 | e[1]);
|
|
3110
|
+
if (e.length === 4) return new Or(e);
|
|
3111
|
+
if (e.length === 8) return new kr(e);
|
|
3112
|
+
throw SyntaxError(`float'...' requires 4, 8, or 16 hex digits (2, 4, or 8 bytes); got ${e.length} bytes`);
|
|
3113
|
+
}
|
|
3114
|
+
function Ar(e) {
|
|
3115
|
+
let t = e >>> 15 & 1, n = e >>> 10 & 31, r = e & 1023, i;
|
|
3116
|
+
if (n === 31) i = t << 31 | 2139095040 | r << 13;
|
|
3117
|
+
else if (n === 0 && r === 0) i = t << 31;
|
|
3118
|
+
else if (n === 0) {
|
|
3119
|
+
let e = r, n = 0;
|
|
3120
|
+
for (; !(e & 512);) e <<= 1, n++;
|
|
3121
|
+
i = t << 31 | 112 - n << 23 | (e & 511) << 14;
|
|
3122
|
+
} else i = t << 31 | n + 112 << 23 | r << 13;
|
|
3123
|
+
let a = /* @__PURE__ */ new Uint8Array(4);
|
|
3124
|
+
return new DataView(a.buffer).setUint32(0, i >>> 0, !1), a;
|
|
3125
|
+
}
|
|
3126
|
+
function jr(e) {
|
|
3127
|
+
let t = e >>> 15 & 1, n = e >>> 10 & 31, r = e & 1023, i = /* @__PURE__ */ new Uint8Array(8), a = new DataView(i.buffer);
|
|
3128
|
+
if (n === 31) a.setUint32(0, (t << 31 | 2146435072 | r << 10) >>> 0, !1), a.setUint32(4, 0, !1);
|
|
3129
|
+
else if (n === 0 && r === 0) a.setUint32(0, t << 31 >>> 0, !1), a.setUint32(4, 0, !1);
|
|
3130
|
+
else if (n === 0) {
|
|
3131
|
+
let e = r, n = 0;
|
|
3132
|
+
for (; !(e & 512);) e <<= 1, n++;
|
|
3133
|
+
a.setUint32(0, (t << 31 | 1008 - n << 20 | (e & 511) << 11) >>> 0, !1), a.setUint32(4, 0, !1);
|
|
3134
|
+
} else a.setUint32(0, (t << 31 | n + 1008 << 20 | r << 10) >>> 0, !1), a.setUint32(4, 0, !1);
|
|
3135
|
+
return i;
|
|
3136
|
+
}
|
|
3137
|
+
function Mr(e) {
|
|
3138
|
+
let t = new DataView(e.buffer, e.byteOffset).getUint32(0, !1), n = t >>> 31 & 1, r = t >>> 23 & 255, i = t & 8388607, a = /* @__PURE__ */ new Uint8Array(8), o = new DataView(a.buffer);
|
|
3139
|
+
if (r === 255) o.setUint32(0, (n << 31 | 2146435072 | i >>> 3) >>> 0, !1), o.setUint32(4, (i & 7) << 29, !1);
|
|
3140
|
+
else if (r === 0 && i === 0) o.setUint32(0, n << 31 >>> 0, !1), o.setUint32(4, 0, !1);
|
|
3141
|
+
else {
|
|
3142
|
+
let t = new DataView(e.buffer, e.byteOffset).getFloat32(0, !1);
|
|
3143
|
+
o.setFloat64(0, t, !1);
|
|
3144
|
+
}
|
|
3145
|
+
return a;
|
|
3146
|
+
}
|
|
3147
|
+
function Nr(e, t, n) {
|
|
3148
|
+
let r = e.length === 2 ? 1 : e.length === 4 ? 2 : 3;
|
|
3149
|
+
if (r === 1) {
|
|
3150
|
+
let n = e[0] << 8 | e[1];
|
|
3151
|
+
if (t === 2) return new Or(Ar(n));
|
|
3152
|
+
if (t === 3) return new kr(jr(n));
|
|
3153
|
+
}
|
|
3154
|
+
if (r === 2) {
|
|
3155
|
+
if (t === 3) return new kr(Mr(e));
|
|
3156
|
+
if (t === 1) {
|
|
3157
|
+
let t = new DataView(e.buffer, e.byteOffset).getFloat32(0, !1), r = S(t);
|
|
3158
|
+
return !Object.is(C(r), t) && !isNaN(t) && n("float'...' value cannot be exactly represented as float16 (_1)"), new Dr(r);
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
if (r === 3) {
|
|
3162
|
+
let r = new DataView(e.buffer, e.byteOffset).getFloat64(0, !1);
|
|
3163
|
+
if (t === 1) {
|
|
3164
|
+
let e = S(r);
|
|
3165
|
+
return !Object.is(C(e), r) && !isNaN(r) && n("float'...' value cannot be exactly represented as float16 (_1)"), new Dr(e);
|
|
3166
|
+
}
|
|
3167
|
+
if (t === 2) {
|
|
3168
|
+
let e = Math.fround(r);
|
|
3169
|
+
!Object.is(e, r) && !isNaN(r) && n("float'...' value cannot be exactly represented as float32 (_2)");
|
|
3170
|
+
let t = /* @__PURE__ */ new Uint8Array(4);
|
|
3171
|
+
return new DataView(t.buffer).setFloat32(0, e, !1), new Or(t);
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
return Z(e);
|
|
3175
|
+
}
|
|
3176
|
+
var Pr = {
|
|
3177
|
+
appStringPrefixes: ["float"],
|
|
3178
|
+
parseAppString(t, n, r, i) {
|
|
3179
|
+
let a = Er(n);
|
|
3180
|
+
if (!/^[0-9a-fA-F]*$/.test(a)) throw SyntaxError("float'...' contains non-hex characters");
|
|
3181
|
+
if (a.length % 2 != 0) throw SyntaxError(`float'...' hex content has odd length (${a.length} digits)`);
|
|
3182
|
+
let o = e(a), s = i?.encodingWidth;
|
|
3183
|
+
if (s === void 0) return Z(o);
|
|
3184
|
+
if (s !== 1 && s !== 2 && s !== 3) {
|
|
3185
|
+
let e = `float'...' encoding indicator _${s} is not valid; use _1, _2, or _3`;
|
|
3186
|
+
if (r) return r(e), Z(o);
|
|
3187
|
+
throw SyntaxError(e);
|
|
3188
|
+
}
|
|
3189
|
+
return s === (o.length === 2 ? 1 : o.length === 4 ? 2 : 3) ? Z(o) : Nr(o, s, r ?? ((e) => {
|
|
3190
|
+
throw SyntaxError(e);
|
|
3191
|
+
}));
|
|
3192
|
+
},
|
|
3193
|
+
parseAppSequence(e, t, n) {
|
|
3194
|
+
if (t.length === 0) throw SyntaxError("float<<...>> requires exactly one byte-string item");
|
|
3195
|
+
if (t.length > 1) {
|
|
3196
|
+
let e = `float<<...>> expects 1 item; got ${t.length} — using first`;
|
|
3197
|
+
if (n) n(e);
|
|
3198
|
+
else throw SyntaxError(e);
|
|
3199
|
+
}
|
|
3200
|
+
if (!(t[0] instanceof N)) throw SyntaxError("float<<...>> item must be a byte string");
|
|
3201
|
+
return Z(t[0].value);
|
|
3202
|
+
}
|
|
3203
|
+
}, Fr = [
|
|
2902
3204
|
Kt,
|
|
2903
3205
|
dn,
|
|
2904
3206
|
mn,
|
|
2905
3207
|
Bn,
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
return new M(ar, new Ue([ir(t.value, r)], { encodingWidth: t.encodingWidth }));
|
|
2918
|
-
} catch (e) {
|
|
2919
|
-
if (r?.strict !== !1) throw e;
|
|
2920
|
-
return;
|
|
2921
|
-
}
|
|
2922
|
-
}
|
|
2923
|
-
}
|
|
2924
|
-
], or;
|
|
2925
|
-
function sr() {
|
|
2926
|
-
return or ??= {
|
|
2927
|
-
fromJS: Z.filter((e) => e.fromJS !== void 0),
|
|
2928
|
-
parseTag: Z.filter((e) => e.parseTag !== void 0)
|
|
3208
|
+
or,
|
|
3209
|
+
gr,
|
|
3210
|
+
_r,
|
|
3211
|
+
wr,
|
|
3212
|
+
Tr,
|
|
3213
|
+
Pr
|
|
3214
|
+
], Ir;
|
|
3215
|
+
function Lr() {
|
|
3216
|
+
return Ir ??= {
|
|
3217
|
+
fromJS: Fr.filter((e) => e.fromJS !== void 0),
|
|
3218
|
+
parseTag: Fr.filter((e) => e.parseTag !== void 0)
|
|
2929
3219
|
};
|
|
2930
3220
|
}
|
|
2931
|
-
function
|
|
2932
|
-
let t = e?.extensions, n =
|
|
3221
|
+
function Rr(e) {
|
|
3222
|
+
let t = e?.extensions, n = Lr();
|
|
2933
3223
|
return t?.length ? {
|
|
2934
3224
|
fromJS: [...t.filter((e) => e.fromJS !== void 0), ...n.fromJS],
|
|
2935
3225
|
parseTag: [...t.filter((e) => e.parseTag !== void 0), ...n.parseTag]
|
|
2936
3226
|
} : n;
|
|
2937
3227
|
}
|
|
2938
|
-
function
|
|
3228
|
+
function zr(e, t) {
|
|
2939
3229
|
if (t?.replacer) {
|
|
2940
|
-
let { replacer: n, ...r } = t, i =
|
|
2941
|
-
return i === h ? R.UNDEFINED :
|
|
3230
|
+
let { replacer: n, ...r } = t, i = Vr(e, n, r.extensions, r.undefinedOmits);
|
|
3231
|
+
return i === h ? R.UNDEFINED : zr(i, Object.keys(r).length > 0 ? r : void 0);
|
|
2942
3232
|
}
|
|
2943
|
-
return Q(e, t, !0,
|
|
3233
|
+
return Q(e, t, !0, Rr(t));
|
|
2944
3234
|
}
|
|
2945
3235
|
function Q(e, t, n, r) {
|
|
2946
3236
|
for (let n of r.fromJS) {
|
|
@@ -2977,11 +3267,11 @@ function Q(e, t, n, r) {
|
|
|
2977
3267
|
}
|
|
2978
3268
|
throw TypeError(`fromJS: unsupported value type: ${typeof e}`);
|
|
2979
3269
|
}
|
|
2980
|
-
function
|
|
3270
|
+
function Br(e) {
|
|
2981
3271
|
return ArrayBuffer.isView(e) || e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer || e instanceof Number || e instanceof Boolean || e instanceof String || Object.prototype.toString.call(e) === "[object BigInt]" || e instanceof m.Null || e instanceof m.Undefined || e instanceof g;
|
|
2982
3272
|
}
|
|
2983
|
-
function
|
|
2984
|
-
let i = [...n ?? [], ...
|
|
3273
|
+
function Vr(e, t, n, r) {
|
|
3274
|
+
let i = [...n ?? [], ...Fr].filter((e) => e.isJSType !== void 0);
|
|
2985
3275
|
function a(e) {
|
|
2986
3276
|
return e === h || r === !0 && e === void 0;
|
|
2987
3277
|
}
|
|
@@ -2991,7 +3281,7 @@ function dr(e, t, n, r) {
|
|
|
2991
3281
|
if (typeof e != "object" || !e) return e;
|
|
2992
3282
|
if (e instanceof $) return $.from(e, ([e, t]) => [e, r(t)]);
|
|
2993
3283
|
if (Array.isArray(e)) return e.map(r);
|
|
2994
|
-
if (m.symbol in e ||
|
|
3284
|
+
if (m.symbol in e || Br(e) || i.some((t) => t.isJSType(e))) return e;
|
|
2995
3285
|
let t = Object.getPrototypeOf(e);
|
|
2996
3286
|
if (t === Object.prototype || t === null) {
|
|
2997
3287
|
let t = e.toJSON;
|
|
@@ -3026,7 +3316,7 @@ function dr(e, t, n, r) {
|
|
|
3026
3316
|
let r = s(t, String(n), e);
|
|
3027
3317
|
return a(r) ? null : r;
|
|
3028
3318
|
});
|
|
3029
|
-
if (
|
|
3319
|
+
if (Br(e) || i.some((t) => t.isJSType(e))) return e;
|
|
3030
3320
|
let t = {};
|
|
3031
3321
|
for (let n of Object.keys(e)) {
|
|
3032
3322
|
let r = s(e[n], n, e);
|
|
@@ -3044,7 +3334,7 @@ var $ = class extends Array {
|
|
|
3044
3334
|
toJSON() {
|
|
3045
3335
|
let e = {};
|
|
3046
3336
|
for (let [t, n] of this) {
|
|
3047
|
-
let r = typeof t == "string" ? t :
|
|
3337
|
+
let r = typeof t == "string" ? t : zr(t).toCDN();
|
|
3048
3338
|
r === "__proto__" ? Object.defineProperty(e, r, {
|
|
3049
3339
|
value: n,
|
|
3050
3340
|
writable: !0,
|
|
@@ -3056,6 +3346,6 @@ var $ = class extends Array {
|
|
|
3056
3346
|
}
|
|
3057
3347
|
};
|
|
3058
3348
|
//#endregion
|
|
3059
|
-
export {
|
|
3349
|
+
export { o as A, M as C, O as D, k as E, m as M, c as N, g as O, N as S, A as T, R as _, Er as a, F as b, _r as c, qt as d, B as f, Ue as g, et as h, Pr as i, s as j, h as k, gr as l, tt as m, Vr as n, wr as o, at as p, zr as r, Tr as s, $ as t, ir as u, L as v, j as w, P as x, I as y };
|
|
3060
3350
|
|
|
3061
|
-
//# sourceMappingURL=mapEntries-
|
|
3351
|
+
//# sourceMappingURL=mapEntries-BdzS6bFp.js.map
|