@cbortech/cbor 0.26.0 → 0.26.2

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/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { o as e } from "./tokenizer-CeuixxXi.js";
2
- import { A as t, M as n, N as r, O as i, S as a, a as o, c as s, d as c, i as l, j as u, k as d, l as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y } from "./mapEntries-BdzS6bFp.js";
2
+ import { E as t, F as n, I as r, L as i, M as a, N as o, P as s, _ as c, a as l, c as u, d, f, h as p, i as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C } from "./mapEntries-KwZz9nq2.js";
3
3
  //#region src/extensions/b32.ts
4
- var b = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", x = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
5
- function S(e) {
4
+ var w = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", T = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
5
+ function E(e) {
6
6
  let t = e.length;
7
7
  for (; t > 0 && e.charCodeAt(t - 1) === 61;) t--;
8
8
  return e.slice(0, t);
9
9
  }
10
- function C(e, t, n) {
11
- let r = S(e).toUpperCase(), i = r.length % 8;
10
+ function D(e, t, n) {
11
+ let r = E(e).toUpperCase(), i = r.length % 8;
12
12
  if (i === 1 || i === 3 || i === 6) throw SyntaxError(`invalid base32 length: ${r.length} characters`);
13
13
  let a = (/* @__PURE__ */ new Uint8Array(128)).fill(255);
14
14
  for (let e = 0; e < t.length; e++) a[t.charCodeAt(e)] = e;
@@ -25,44 +25,44 @@ function C(e, t, n) {
25
25
  }
26
26
  return o;
27
27
  }
28
- var w = {
28
+ var O = {
29
29
  appStringPrefixes: ["b32"],
30
- parseAppString(e, t, n) {
31
- return new a(C(o(t), b, n), { ednEncoding: "base32" });
30
+ parseAppString(e, n, r) {
31
+ return new t(D(v(n), w, r), { ednEncoding: "base32" });
32
32
  }
33
- }, T = {
33
+ }, k = {
34
34
  appStringPrefixes: ["h32"],
35
- parseAppString(e, t, n) {
36
- return new a(C(o(t), x, n), { ednEncoding: "base32hex" });
35
+ parseAppString(e, n, r) {
36
+ return new t(D(v(n), T, r), { ednEncoding: "base32hex" });
37
37
  }
38
38
  };
39
39
  //#endregion
40
40
  //#region src/extensions/same.ts
41
- function E(e, t) {
41
+ function A(e, t) {
42
42
  if (e.length !== t.length) return !1;
43
43
  for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
44
44
  return !0;
45
45
  }
46
- var D = {
46
+ var j = {
47
47
  appStringPrefixes: ["same"],
48
48
  preserveAppSeqSource: !0,
49
49
  parseAppSequence(e, t, n) {
50
50
  if (t.length === 0) throw SyntaxError("same<<...>> requires at least one item");
51
51
  let r = t[0], i = r.toCBOR();
52
- for (let e = 1; e < t.length; e++) if (!E(i, t[e].toCBOR())) {
52
+ for (let e = 1; e < t.length; e++) if (!A(i, t[e].toCBOR())) {
53
53
  let t = `same<<...>>: item ${e} produces different CBOR bytes than item 0`;
54
54
  if (n) n(t);
55
55
  else throw SyntaxError(t);
56
56
  }
57
57
  return r;
58
58
  }
59
- }, O = class r {
60
- static OMIT = d;
61
- static TAG = t;
62
- static Tag = n;
63
- static Simple = i;
64
- static MapEntries = v;
65
- static dt_as_Date = c;
59
+ }, M = class t {
60
+ static OMIT = o;
61
+ static TAG = s;
62
+ static Tag = r;
63
+ static Simple = a;
64
+ static MapEntries = S;
65
+ static dt_as_Date = p;
66
66
  #e;
67
67
  constructor(e) {
68
68
  this.#e = e ?? {};
@@ -73,110 +73,110 @@ var D = {
73
73
  ...e ?? {}
74
74
  };
75
75
  }
76
- fromCBOR(e, t) {
77
- let n = r.fromCBOR(e, this.#t(t));
78
- return n._defaults = this.#e, n;
76
+ fromCBOR(e, n) {
77
+ let r = t.fromCBOR(e, this.#t(n));
78
+ return r._defaults = this.#e, r;
79
79
  }
80
- fromCDN(e, t) {
81
- let n = r.fromCDN(e, this.#t(t));
82
- return n._defaults = this.#e, n;
80
+ fromCDN(e, n) {
81
+ let r = t.fromCDN(e, this.#t(n));
82
+ return r._defaults = this.#e, r;
83
83
  }
84
84
  fromEDN(e, t) {
85
85
  return this.fromCDN(e, t);
86
86
  }
87
- fromJS(e, t) {
88
- let n = r.fromJS(e, this.#t(t));
89
- return n._defaults = this.#e, n;
87
+ fromJS(e, n) {
88
+ let r = t.fromJS(e, this.#t(n));
89
+ return r._defaults = this.#e, r;
90
90
  }
91
- fromHexDump(e, t) {
92
- let n = r.fromHexDump(e, this.#t(t));
93
- return n._defaults = this.#e, n;
91
+ fromHexDump(e, n) {
92
+ let r = t.fromHexDump(e, this.#t(n));
93
+ return r._defaults = this.#e, r;
94
94
  }
95
- *fromCBORSeq(e, t) {
96
- for (let n of r.fromCBORSeq(e, this.#t(t))) n._defaults = this.#e, yield n;
95
+ *fromCBORSeq(e, n) {
96
+ for (let r of t.fromCBORSeq(e, this.#t(n))) r._defaults = this.#e, yield r;
97
97
  }
98
- *fromCDNSeq(e, t) {
99
- for (let n of r.fromCDNSeq(e, this.#t(t))) n._defaults = this.#e, yield n;
98
+ *fromCDNSeq(e, n) {
99
+ for (let r of t.fromCDNSeq(e, this.#t(n))) r._defaults = this.#e, yield r;
100
100
  }
101
- *fromHexDumpSeq(e, t) {
102
- for (let n of r.fromHexDumpSeq(e, this.#t(t))) n._defaults = this.#e, yield n;
101
+ *fromHexDumpSeq(e, n) {
102
+ for (let r of t.fromHexDumpSeq(e, this.#t(n))) r._defaults = this.#e, yield r;
103
103
  }
104
- decode(e, t) {
105
- return r.decode(e, this.#t(t));
104
+ decode(e, n) {
105
+ return t.decode(e, this.#t(n));
106
106
  }
107
- *decodeSeq(e, t) {
108
- yield* r.decodeSeq(e, this.#t(t));
107
+ *decodeSeq(e, n) {
108
+ yield* t.decodeSeq(e, this.#t(n));
109
109
  }
110
- *parseSeq(e, t) {
111
- yield* r.parseSeq(e, this.#t(t));
110
+ *parseSeq(e, n) {
111
+ yield* t.parseSeq(e, this.#t(n));
112
112
  }
113
- encode(e, t) {
114
- return r.encode(e, this.#t(t));
113
+ encode(e, n) {
114
+ return t.encode(e, this.#t(n));
115
115
  }
116
- compile(e, t) {
117
- return r.compile(e, this.#t(t));
116
+ compile(e, n) {
117
+ return t.compile(e, this.#t(n));
118
118
  }
119
- decompile(e, t) {
120
- return r.decompile(e, this.#t(t));
119
+ decompile(e, n) {
120
+ return t.decompile(e, this.#t(n));
121
121
  }
122
- toHex(e, t) {
123
- return r.toHex(e, this.#t(t));
122
+ toHex(e, n) {
123
+ return t.toHex(e, this.#t(n));
124
124
  }
125
- fromHex(e, t) {
126
- return r.fromHex(e, this.#t(t));
125
+ fromHex(e, n) {
126
+ return t.fromHex(e, this.#t(n));
127
127
  }
128
128
  cborToCborEdn(e, t) {
129
129
  return this.cborToCdn(e, t);
130
130
  }
131
- cborToCdn(e, t) {
132
- let n = this.#t(t), i = r.fromCBOR(e, n);
133
- return i._defaults = this.#e, i.toCDN(n);
131
+ cborToCdn(e, n) {
132
+ let r = this.#t(n), i = t.fromCBOR(e, r);
133
+ return i._defaults = this.#e, i.toCDN(r);
134
134
  }
135
135
  cborEdnToCbor(e, t) {
136
136
  return this.cdnToCbor(e, t);
137
137
  }
138
- cdnToCbor(e, t) {
139
- let n = this.#t(t);
140
- return r.fromCDN(e, n).toCBOR(n);
138
+ cdnToCbor(e, n) {
139
+ let r = this.#t(n);
140
+ return t.fromCDN(e, r).toCBOR(r);
141
141
  }
142
- parse(e, t) {
143
- if (typeof t == "function") {
144
- let n = this.#t({ reviver: t });
145
- return r.fromCDN(e, n).toJS(n);
142
+ parse(e, n) {
143
+ if (typeof n == "function") {
144
+ let r = this.#t({ reviver: n });
145
+ return t.fromCDN(e, r).toJS(r);
146
146
  }
147
- let n = this.#t(t);
148
- return r.fromCDN(e, n).toJS(n);
147
+ let r = this.#t(n);
148
+ return t.fromCDN(e, r).toJS(r);
149
149
  }
150
- stringify(e, t, n) {
151
- if (typeof t == "function" || Array.isArray(t) || t === null || t === void 0 && n !== void 0) {
150
+ stringify(e, n, r) {
151
+ if (typeof n == "function" || Array.isArray(n) || n === null || n === void 0 && r !== void 0) {
152
152
  let i = { ...this.#e };
153
- return t === null ? i.replacer = void 0 : (typeof t == "function" || Array.isArray(t)) && (i.replacer = t), n !== void 0 && (i.indent = F(n)), r.stringify(e, i);
153
+ return n === null ? i.replacer = void 0 : (typeof n == "function" || Array.isArray(n)) && (i.replacer = n), r !== void 0 && (i.indent = z(r)), t.stringify(e, i);
154
154
  }
155
- return r.stringify(e, this.#t(t ?? void 0));
155
+ return t.stringify(e, this.#t(n ?? void 0));
156
156
  }
157
- format(e, t) {
158
- return r.format(e, this.#t(t));
157
+ format(e, n) {
158
+ return t.format(e, this.#t(n));
159
159
  }
160
160
  static fromCBOR(e, t) {
161
- return y(e, t);
161
+ return d(e, t);
162
162
  }
163
163
  static fromCDN(e, t) {
164
- return h(e, t);
164
+ return c(e, t);
165
165
  }
166
- static fromEDN(e, t) {
167
- return r.fromCDN(e, t);
166
+ static fromEDN(e, n) {
167
+ return t.fromCDN(e, n);
168
168
  }
169
- static *fromHexDumpSeq(e, t) {
170
- let n = [], i = k(e).trim().split(/\s+/).filter(Boolean);
171
- for (let e of i) if (/^[0-9A-Fa-f]{2}$/.test(e)) n.push(parseInt(e, 16));
172
- else if (/^[0-9A-Fa-f]+$/.test(e) && e.length % 2 == 0) for (let t = 0; t < e.length; t += 2) n.push(parseInt(e.slice(t, t + 2), 16));
169
+ static *fromHexDumpSeq(e, n) {
170
+ let r = [], i = N(e).trim().split(/\s+/).filter(Boolean);
171
+ for (let e of i) if (/^[0-9A-Fa-f]{2}$/.test(e)) r.push(parseInt(e, 16));
172
+ else if (/^[0-9A-Fa-f]+$/.test(e) && e.length % 2 == 0) for (let t = 0; t < e.length; t += 2) r.push(parseInt(e.slice(t, t + 2), 16));
173
173
  else throw SyntaxError(`Invalid hex token in dump: ${JSON.stringify(e)}`);
174
- yield* r.fromCBORSeq(new Uint8Array(n), t);
174
+ yield* t.fromCBORSeq(new Uint8Array(r), n);
175
175
  }
176
176
  static *fromCBORSeq(e, t) {
177
177
  let n = e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength), r = 0;
178
178
  for (; r < n.byteLength;) {
179
- let e = y(n, {
179
+ let e = d(n, {
180
180
  ...t,
181
181
  offset: r,
182
182
  allowTrailing: !0
@@ -187,22 +187,22 @@ var D = {
187
187
  static *fromCDNSeq(t, n) {
188
188
  let r = !!n?.preserveComments, i = 0, a = !0;
189
189
  for (;;) {
190
- let { offset: o, hadSeparator: s, commaOffset: c } = P(t, i, n, r ? a ? "all" : "after-newline" : "none");
191
- if (a && c >= 0) {
190
+ let { offset: o, hadSeparator: s, commaOffset: l } = R(t, i, n, r ? a ? "all" : "after-newline" : "none");
191
+ if (a && l >= 0) {
192
192
  let e = "leading comma in CDN sequence";
193
193
  if (n?.strict !== !1) throw SyntaxError(e);
194
- M(e, c, n);
194
+ I(e, l, n);
195
195
  }
196
- if (o >= t.length || r && N(t, o) && P(t, o, n).offset >= t.length) break;
196
+ if (o >= t.length || r && L(t, o) && R(t, o, n).offset >= t.length) break;
197
197
  if (!a && !s) {
198
198
  let e = "CDN sequence items must be separated by whitespace, comma, or comment";
199
199
  if (n?.strict !== !1) throw SyntaxError(e);
200
- M(e, o, n);
200
+ I(e, o, n);
201
201
  }
202
202
  i = o;
203
- let l;
203
+ let u;
204
204
  try {
205
- l = h(t, {
205
+ u = c(t, {
206
206
  ...n,
207
207
  offset: i,
208
208
  allowTrailing: !0,
@@ -210,142 +210,142 @@ var D = {
210
210
  });
211
211
  } catch (t) {
212
212
  if (n?.strict !== !1) throw t;
213
- M(t instanceof Error ? t.message : String(t), i, n, !0, t instanceof e ? t : void 0);
213
+ I(t instanceof Error ? t.message : String(t), i, n, !0, t instanceof e ? t : void 0);
214
214
  break;
215
215
  }
216
- yield l, i = l.end, a = !1;
216
+ yield u, i = u.end, a = !1;
217
217
  }
218
218
  }
219
219
  static fromJS(e, t) {
220
- return g(e, t);
220
+ return b(e, t);
221
221
  }
222
222
  static fromHexDump(e, t) {
223
- let n = [], r = k(e).trim().split(/\s+/).filter(Boolean);
223
+ let n = [], r = N(e).trim().split(/\s+/).filter(Boolean);
224
224
  for (let e of r) if (/^[0-9A-Fa-f]{2}$/.test(e)) n.push(parseInt(e, 16));
225
225
  else if (/^[0-9A-Fa-f]+$/.test(e) && e.length % 2 == 0) for (let t = 0; t < e.length; t += 2) n.push(parseInt(e.slice(t, t + 2), 16));
226
226
  else throw SyntaxError(`Invalid hex token in dump: ${JSON.stringify(e)}`);
227
- return y(new Uint8Array(n), t);
227
+ return d(new Uint8Array(n), t);
228
228
  }
229
- static decode(e, t) {
230
- return r.fromCBOR(e, t).toJS(t);
229
+ static decode(e, n) {
230
+ return t.fromCBOR(e, n).toJS(n);
231
231
  }
232
- static *decodeSeq(e, t) {
233
- for (let n of r.fromCBORSeq(e, t)) yield n.toJS(t);
232
+ static *decodeSeq(e, n) {
233
+ for (let r of t.fromCBORSeq(e, n)) yield r.toJS(n);
234
234
  }
235
- static *parseSeq(e, t) {
236
- for (let n of r.fromCDNSeq(e, t)) yield n.toJS(t);
235
+ static *parseSeq(e, n) {
236
+ for (let r of t.fromCDNSeq(e, n)) yield r.toJS(n);
237
237
  }
238
- static encode(e, t) {
239
- return r.fromJS(e, t).toCBOR(t);
238
+ static encode(e, n) {
239
+ return t.fromJS(e, n).toCBOR(n);
240
240
  }
241
- static compile(e, t) {
242
- let n = [...r.fromCDNSeq(e, t)].map((e) => e.toCBOR(t)), i = n.reduce((e, t) => e + t.length, 0), a = new Uint8Array(i), o = 0;
243
- for (let e of n) a.set(e, o), o += e.length;
241
+ static compile(e, n) {
242
+ let r = [...t.fromCDNSeq(e, n)].map((e) => e.toCBOR(n)), i = r.reduce((e, t) => e + t.length, 0), a = new Uint8Array(i), o = 0;
243
+ for (let e of r) a.set(e, o), o += e.length;
244
244
  return a;
245
245
  }
246
- static decompile(e, t) {
247
- return [...r.fromCBORSeq(e, t)].map((e) => e.toCDN(t)).join("\n");
246
+ static decompile(e, n) {
247
+ return [...t.fromCBORSeq(e, n)].map((e) => e.toCDN(n)).join("\n");
248
248
  }
249
- static toHex(e, t) {
250
- return [...r.fromCBORSeq(e, t)].map((e) => e.toHexDump(t)).join("\n");
249
+ static toHex(e, n) {
250
+ return [...t.fromCBORSeq(e, n)].map((e) => e.toHexDump(n)).join("\n");
251
251
  }
252
- static fromHex(e, t) {
253
- let n = [...r.fromHexDumpSeq(e, t)].map((e) => e.toCBOR(t)), i = n.reduce((e, t) => e + t.length, 0), a = new Uint8Array(i), o = 0;
254
- for (let e of n) a.set(e, o), o += e.length;
252
+ static fromHex(e, n) {
253
+ let r = [...t.fromHexDumpSeq(e, n)].map((e) => e.toCBOR(n)), i = r.reduce((e, t) => e + t.length, 0), a = new Uint8Array(i), o = 0;
254
+ for (let e of r) a.set(e, o), o += e.length;
255
255
  return a;
256
256
  }
257
- static cborToCdn(e, t) {
258
- return r.fromCBOR(e, t).toCDN(t);
257
+ static cborToCdn(e, n) {
258
+ return t.fromCBOR(e, n).toCDN(n);
259
259
  }
260
- static cborToCborEdn(e, t) {
261
- return r.fromCBOR(e, t).toCDN(t);
260
+ static cborToCborEdn(e, n) {
261
+ return t.fromCBOR(e, n).toCDN(n);
262
262
  }
263
- static cdnToCbor(e, t) {
264
- return r.fromCDN(e, t).toCBOR(t);
263
+ static cdnToCbor(e, n) {
264
+ return t.fromCDN(e, n).toCBOR(n);
265
265
  }
266
- static cborEdnToCbor(e, t) {
267
- return r.fromCDN(e, t).toCBOR(t);
266
+ static cborEdnToCbor(e, n) {
267
+ return t.fromCDN(e, n).toCBOR(n);
268
268
  }
269
- static parse(e, t) {
270
- return typeof t == "function" ? r.fromCDN(e).toJS({ reviver: t }) : r.fromCDN(e, t).toJS(t);
269
+ static parse(e, n) {
270
+ return typeof n == "function" ? t.fromCDN(e).toJS({ reviver: n }) : t.fromCDN(e, n).toJS(n);
271
271
  }
272
272
  static stringify(e, t, n) {
273
273
  if (typeof t == "function" || Array.isArray(t) || t === null || t === void 0 && n !== void 0) {
274
- let r = typeof t == "function" || Array.isArray(t) ? t : void 0, i = F(n);
274
+ let r = typeof t == "function" || Array.isArray(t) ? t : void 0, i = z(n);
275
275
  if (r) {
276
- let t = p(e, r);
277
- return t === void 0 || t === d ? void 0 : g(t).toCDN(i === void 0 ? void 0 : { indent: i });
276
+ let t = _(e, r);
277
+ return t === void 0 || t === o ? void 0 : b(t).toCDN(i === void 0 ? void 0 : { indent: i });
278
278
  }
279
- return g(e).toCDN(i === void 0 ? void 0 : { indent: i });
279
+ return b(e).toCDN(i === void 0 ? void 0 : { indent: i });
280
280
  }
281
281
  let r = t;
282
282
  if (r?.replacer) {
283
- let t = p(e, r.replacer, r.extensions, r.undefinedOmits);
284
- if (t === void 0 || t === d) return;
283
+ let t = _(e, r.replacer, r.extensions, r.undefinedOmits, r.builtinExtensions);
284
+ if (t === void 0 || t === o) return;
285
285
  let { replacer: n, ...i } = r;
286
- return g(t, Object.keys(i).length > 0 ? i : void 0).toCDN(r);
286
+ return b(t, Object.keys(i).length > 0 ? i : void 0).toCDN(r);
287
287
  }
288
- return g(e, r).toCDN(r);
288
+ return b(e, r).toCDN(r);
289
289
  }
290
- static format(e, t) {
291
- return r.fromCDN(e, t).toCDN(t);
290
+ static format(e, n) {
291
+ return t.fromCDN(e, n).toCDN(n);
292
292
  }
293
293
  };
294
- function k(e) {
294
+ function N(e) {
295
295
  let t = "", n = 0;
296
296
  for (; n < e.length;) {
297
297
  let r = e[n], i = e[n + 1] ?? "";
298
298
  if (r === "-" && i === "-") {
299
- n = A(e, n + 2), t += " ";
299
+ n = P(e, n + 2), t += " ";
300
300
  continue;
301
301
  }
302
302
  if (r === "—") {
303
- n = A(e, n + 1), t += " ";
303
+ n = P(e, n + 1), t += " ";
304
304
  continue;
305
305
  }
306
306
  if (r === "#") {
307
- n = A(e, n + 1), t += " ";
307
+ n = P(e, n + 1), t += " ";
308
308
  continue;
309
309
  }
310
310
  if (r === "/" && i === "/") {
311
- n = A(e, n + 2), t += " ";
311
+ n = P(e, n + 2), t += " ";
312
312
  continue;
313
313
  }
314
314
  if (r === "/" && i === "*") {
315
315
  let r = e.indexOf("*/", n + 2);
316
316
  if (r < 0) throw SyntaxError("Unterminated comment in hex dump");
317
- t += j(e.slice(n, r + 2)), n = r + 2;
317
+ t += F(e.slice(n, r + 2)), n = r + 2;
318
318
  continue;
319
319
  }
320
320
  if (r === "/") {
321
321
  let r = e.indexOf("/", n + 1);
322
322
  if (r < 0) throw SyntaxError("Unterminated comment in hex dump");
323
- t += j(e.slice(n, r + 1)), n = r + 1;
323
+ t += F(e.slice(n, r + 1)), n = r + 1;
324
324
  continue;
325
325
  }
326
326
  t += r, n++;
327
327
  }
328
328
  return t;
329
329
  }
330
- function A(e, t) {
330
+ function P(e, t) {
331
331
  let n = e.indexOf("\n", t);
332
332
  return n < 0 ? e.length : n;
333
333
  }
334
- function j(e) {
334
+ function F(e) {
335
335
  return e.replace(/[^\r\n]/g, " ");
336
336
  }
337
- function M(e, t, n, r, i) {
337
+ function I(e, t, n, r, i) {
338
338
  let a = i?.offset ?? t, o = {
339
339
  message: e,
340
340
  offset: a
341
341
  };
342
342
  r && (o.fatal = !0), i?.offset !== void 0 && (o.line = i.line, o.column = i.column, o.endOffset = i.endOffset), n?.onWarning ? n.onWarning(o) : n?.silent || console.warn(`CDN sequence warning at offset ${a}: ${e}`);
343
343
  }
344
- function N(e, t) {
344
+ function L(e, t) {
345
345
  let n = e[t];
346
346
  return n === "#" || n === "/";
347
347
  }
348
- function P(e, t, n, r = "none") {
348
+ function R(e, t, n, r = "none") {
349
349
  let i = t, a = !1, o = !1, s = !1, c = -1, l = () => r === "all" || r === "after-newline" && s;
350
350
  for (; i < e.length;) {
351
351
  let t = e[i];
@@ -375,7 +375,7 @@ function P(e, t, n, r = "none") {
375
375
  if (t < 0) {
376
376
  let t = "unterminated /* comment in CDN sequence";
377
377
  if (n?.strict !== !1) throw SyntaxError(t);
378
- M(t, i, n, !0), i = e.length;
378
+ I(t, i, n, !0), i = e.length;
379
379
  } else e.slice(i, t).includes("\n") && (s = !0), i = t + 2;
380
380
  continue;
381
381
  }
@@ -385,7 +385,7 @@ function P(e, t, n, r = "none") {
385
385
  if (t < 0) {
386
386
  let t = "unterminated / comment in CDN sequence";
387
387
  if (n?.strict !== !1) throw SyntaxError(t);
388
- M(t, i, n, !0), i = e.length;
388
+ I(t, i, n, !0), i = e.length;
389
389
  } else e.slice(i, t).includes("\n") && (s = !0), i = t + 1;
390
390
  continue;
391
391
  }
@@ -401,7 +401,7 @@ function P(e, t, n, r = "none") {
401
401
  commaOffset: c
402
402
  };
403
403
  }
404
- function F(e) {
404
+ function z(e) {
405
405
  if (typeof e == "number") {
406
406
  let t = Math.floor(Math.min(10, Math.max(0, e)));
407
407
  return t === 0 ? void 0 : t;
@@ -409,6 +409,6 @@ function F(e) {
409
409
  if (typeof e == "string") return e.slice(0, 10) || void 0;
410
410
  }
411
411
  //#endregion
412
- export { O as CBOR, O as default, d as CBOR_OMIT, t as CBOR_TAG, e as CdnSyntaxError, v as MapEntries, u as Null, i as Simple, n as Tag, r as Undefined, s as b1, w as b32, c as dt_as_Date, l as float, T as h32, m as ilbs, _ as ilts, D as same, f as t1 };
412
+ export { m as BUILTIN_EXTENSIONS, M as CBOR, M as default, o as CBOR_OMIT, s as CBOR_TAG, e as CdnSyntaxError, S as MapEntries, n as Null, a as Simple, r as Tag, i as Undefined, h as b1, O as b32, f as cri, g as dt, p as dt_as_Date, l as float, k as h32, x as ilbs, u as ilts, y as ip, j as same, C as t1 };
413
413
 
414
414
  //# sourceMappingURL=index.js.map