@cbortech/cbor 0.26.3 → 0.26.4

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.
@@ -1823,7 +1823,8 @@ var pt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1823
1823
  let r = `app-string prefix '${e}' requires an extension that is not enabled; ${n}`;
1824
1824
  this._options.onWarning ? this._options.onWarning({
1825
1825
  message: r,
1826
- ..._t(t)
1826
+ ..._t(t),
1827
+ hint: !0
1827
1828
  }) : this._options.silent || console.warn(`CDN: ${r}`);
1828
1829
  }
1829
1830
  _warn(e, t) {
@@ -3017,17 +3018,25 @@ var or = 24n, sr = {
3017
3018
  tagNumbers: [or],
3018
3019
  parseTag(e, t, n) {
3019
3020
  if (e !== 24n || !(t instanceof P)) return;
3020
- let r = n ? {
3021
+ let r = (t.end ?? t.value.length) - t.value.length, i = n ? {
3021
3022
  extensions: n.extensions,
3022
3023
  builtinExtensions: n.builtinExtensions,
3023
3024
  strict: n.strict,
3024
- onWarning: n.onWarning,
3025
+ onWarning: n.onWarning ? (e) => n.onWarning({
3026
+ ...e,
3027
+ offset: e.offset + r
3028
+ }) : void 0,
3025
3029
  silent: n.silent
3026
3030
  } : void 0;
3027
3031
  try {
3028
- return new N(or, new He([ar(t.value, r)], { encodingWidth: t.encodingWidth }));
3032
+ return new N(or, new He([ar(t.value, i)], { encodingWidth: t.encodingWidth }));
3029
3033
  } catch (e) {
3030
- if (r?.strict !== !1) throw e;
3034
+ if (i?.strict !== !1) throw e;
3035
+ let t = `tag 24 content is not valid CBOR: ${e instanceof Error ? e.message : String(e)}`, a = {
3036
+ message: t,
3037
+ offset: r
3038
+ };
3039
+ n?.onWarning ? n.onWarning(a) : n?.silent || console.warn(`CBOR strict violation at offset ${a.offset}: ${t}`);
3031
3040
  return;
3032
3041
  }
3033
3042
  }
@@ -3509,4 +3518,4 @@ var $ = class extends Array {
3509
3518
  //#endregion
3510
3519
  export { A, L as C, N as D, P as E, s as F, m as I, c as L, g as M, h as N, M as O, o as P, R as S, F as T, it as _, zr as a, He as b, kr as c, ar as d, Ln as f, H as g, Kt as h, Vr as i, k as j, j as k, xr as l, Gt as m, Jr as n, Ar as o, un as p, Kr as r, Or as s, $ as t, br as u, et as v, I as w, z as x, $e as y };
3511
3520
 
3512
- //# sourceMappingURL=mapEntries-BZCOgqIt.js.map
3521
+ //# sourceMappingURL=mapEntries-hyNVtz5Z.js.map