typeson-registry 9.1.1 → 9.2.1

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.
Files changed (40) hide show
  1. package/README.md +6 -2
  2. package/dist/index.d.ts +2 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +90 -27
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist/index.umd.cjs +95 -25
  9. package/dist/index.umd.cjs.map +1 -1
  10. package/dist/index.umd.min.cjs +1 -1
  11. package/dist/index.umd.min.cjs.map +1 -1
  12. package/dist/presets/builtin.umd.cjs +1 -1
  13. package/dist/presets/builtin.umd.cjs.map +1 -1
  14. package/dist/presets/postmessage.umd.cjs +1 -1
  15. package/dist/presets/postmessage.umd.cjs.map +1 -1
  16. package/dist/presets/socketio.umd.cjs +1 -1
  17. package/dist/presets/socketio.umd.cjs.map +1 -1
  18. package/dist/presets/structured-cloning-throwing.umd.cjs +1 -1
  19. package/dist/presets/structured-cloning-throwing.umd.cjs.map +1 -1
  20. package/dist/presets/structured-cloning.d.ts.map +1 -1
  21. package/dist/presets/structured-cloning.umd.cjs +1 -1
  22. package/dist/presets/structured-cloning.umd.cjs.map +1 -1
  23. package/dist/presets/universal.umd.cjs +1 -1
  24. package/dist/presets/universal.umd.cjs.map +1 -1
  25. package/dist/types/dommatrix.d.ts.map +1 -1
  26. package/dist/types/dommatrix.umd.cjs +1 -1
  27. package/dist/types/dommatrix.umd.cjs.map +1 -1
  28. package/dist/types/dompoint.d.ts.map +1 -1
  29. package/dist/types/dompoint.umd.cjs +1 -1
  30. package/dist/types/dompoint.umd.cjs.map +1 -1
  31. package/dist/types/domquad.d.ts +6 -0
  32. package/dist/types/domquad.d.ts.map +1 -0
  33. package/dist/types/domquad.umd.cjs +2 -0
  34. package/dist/types/domquad.umd.cjs.map +1 -0
  35. package/dist/types/domrect.d.ts.map +1 -1
  36. package/dist/types/domrect.umd.cjs +1 -1
  37. package/dist/types/domrect.umd.cjs.map +1 -1
  38. package/dist/types/errors.umd.cjs +1 -1
  39. package/dist/types/errors.umd.cjs.map +1 -1
  40. package/package.json +21 -20
package/README.md CHANGED
@@ -232,8 +232,12 @@ Note that the type name corresponds to the file name in the following manner:
232
232
  - `date`
233
233
  - `domexception`
234
234
  - `dommatrix`
235
+ - `dommatrixreadonly`
235
236
  - `dompoint`
237
+ - `dompointreadonly`
238
+ - `domquad`
236
239
  - `domrect`
240
+ - `domrectreadonly`
237
241
  - `error.js` (`Error`) and `errors.js` (`TypeError`, `RangeError`, `SyntaxError`, `ReferenceError`, `EvalError`, `URIError`, `InternalError`) - These
238
242
  provide a means of resurrecting error object across cloning boundaries
239
243
  (since they are not otherwise treated as cloneable by the Structured
@@ -251,8 +255,8 @@ Note that the type name corresponds to the file name in the following manner:
251
255
  Not all properties can be preserved
252
256
  - `map`
253
257
  - `nan` - Preserves `NaN` (not a number)
254
- - `NegativeInfinity` - Preserves negative infinity
255
- - `negative-zero` - Preserves `-0` (produces + or - Infinity when used as divisor)
258
+ - `negativeInfinity` - Preserves negative infinity
259
+ - `negativeZero` - Preserves `-0` (produces + or - Infinity when used as divisor)
256
260
  - `nonBuiltInIgnore` - For roughly detecting non-builtin objects and to avoid
257
261
  adding them as properties
258
262
  - `primitive-objects.js` (`StringObject`, `BooleanObject`, `NumberObject`)
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import date from './types/date.js';
10
10
  import domexception from './types/domexception.js';
11
11
  import dommatrix from './types/dommatrix.js';
12
12
  import dompoint from './types/dompoint.js';
13
+ import domquad from './types/domquad.js';
13
14
  import domrect from './types/domrect.js';
14
15
  import error from './types/error.js';
15
16
  import errors from './types/errors.js';
@@ -42,5 +43,5 @@ import structuredCloningThrowing from './presets/structured-cloning-throwing.js'
42
43
  import structuredCloning from './presets/structured-cloning.js';
43
44
  import undefPreset from './presets/undef.js';
44
45
  import universal from './presets/universal.js';
45
- export { arraybuffer, bigintObject, bigint, blob, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domrect, error, errors, file, filelist, imagebitmap, imagedata, infinity, intlTypes, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, primitiveObjects, regexp, resurrectable, set, typedArraysSocketio, typedArrays, undef, userObject, arrayNonindexKeys, builtin, postmessage, socketio, sparseUndefined, specialNumbers, structuredCloningThrowing, structuredCloning, undefPreset, universal };
46
+ export { arraybuffer, bigintObject, bigint, blob, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, error, errors, file, filelist, imagebitmap, imagedata, infinity, intlTypes, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, primitiveObjects, regexp, resurrectable, set, typedArraysSocketio, typedArrays, undef, userObject, arrayNonindexKeys, builtin, postmessage, socketio, sparseUndefined, specialNumbers, structuredCloningThrowing, structuredCloning, undefPreset, universal };
46
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":";wBAGwB,wBAAwB;yBACvB,0BAA0B;mBAChC,mBAAmB;iBACrB,iBAAiB;sBACZ,sBAAsB;sBACtB,sBAAsB;qBACvB,qBAAqB;iBACzB,iBAAiB;yBACT,yBAAyB;sBAC5B,sBAAsB;qBACvB,qBAAqB;oBACtB,oBAAoB;kBACtB,kBAAkB;mBACjB,mBAAmB;iBACrB,iBAAiB;qBACb,qBAAqB;wBAClB,wBAAwB;sBAC1B,sBAAsB;qBACvB,qBAAqB;sBACpB,uBAAuB;gBAC7B,gBAAgB;gBAChB,gBAAgB;6BACH,8BAA8B;yBAClC,0BAA0B;6BACtB,8BAA8B;6BAC9B,8BAA8B;mBACxC,mBAAmB;0BACZ,0BAA0B;gBACpC,gBAAgB;gCACA,kCAAkC;wBAC1C,yBAAyB;kBAC/B,kBAAkB;uBACb,wBAAwB;8BAGjB,kCAAkC;oBAC5C,sBAAsB;wBAClB,0BAA0B;qBAC7B,uBAAuB;4BAChB,+BAA+B;2BAChC,8BAA8B;sCAErD,0CAA0C;8BAChB,iCAAiC;wBACvC,oBAAoB;sBACtB,wBAAwB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":";wBAGwB,wBAAwB;yBACvB,0BAA0B;mBAChC,mBAAmB;iBACrB,iBAAiB;sBACZ,sBAAsB;sBACtB,sBAAsB;qBACvB,qBAAqB;iBACzB,iBAAiB;yBACT,yBAAyB;sBAC5B,sBAAsB;qBACvB,qBAAqB;oBACtB,oBAAoB;oBACpB,oBAAoB;kBACtB,kBAAkB;mBACjB,mBAAmB;iBACrB,iBAAiB;qBACb,qBAAqB;wBAClB,wBAAwB;sBAC1B,sBAAsB;qBACvB,qBAAqB;sBACpB,uBAAuB;gBAC7B,gBAAgB;gBAChB,gBAAgB;6BACH,8BAA8B;yBAClC,0BAA0B;6BACtB,8BAA8B;6BAC9B,8BAA8B;mBACxC,mBAAmB;0BACZ,0BAA0B;gBACpC,gBAAgB;gCACA,kCAAkC;wBAC1C,yBAAyB;kBAC/B,kBAAkB;uBACb,wBAAwB;8BAGjB,kCAAkC;oBAC5C,sBAAsB;wBAClB,0BAA0B;qBAC7B,uBAAuB;4BAChB,+BAA+B;2BAChC,8BAA8B;sCAErD,0CAA0C;8BAChB,iCAAiC;wBACvC,oBAAoB;sBACtB,wBAAwB"}
package/dist/index.js CHANGED
@@ -500,14 +500,29 @@ const domexception = {
500
500
  }
501
501
  };
502
502
 
503
- /* globals DOMMatrix */
503
+ /* globals DOMMatrix, DOMMatrixReadOnly */
504
504
 
505
505
  /**
506
506
  * @type {import('typeson').TypeSpecSet}
507
507
  */
508
- const dommatrix = {
509
- dommatrix: {
510
- test (x) { return toStringTag(x) === 'DOMMatrix'; },
508
+ const dommatrix = {};
509
+
510
+ /* c8 ignore next */
511
+ if (typeof DOMMatrix !== 'undefined') {
512
+ create$5(DOMMatrix);
513
+ }
514
+ /* c8 ignore next */
515
+ if (typeof DOMMatrixReadOnly !== 'undefined') {
516
+ create$5(DOMMatrixReadOnly);
517
+ }
518
+
519
+ /**
520
+ * @param {typeof DOMMatrix|typeof DOMMatrixReadOnly} Ctor
521
+ * @returns {void}
522
+ */
523
+ function create$5 (Ctor) {
524
+ dommatrix[Ctor.name.toLowerCase()] = {
525
+ test (x) { return toStringTag(x) === Ctor.name; },
511
526
  replace (dm) {
512
527
  if (dm.is2D) {
513
528
  return {
@@ -540,26 +555,41 @@ const dommatrix = {
540
555
  },
541
556
  revive (o) {
542
557
  if (Object.hasOwn(o, 'a')) {
543
- return new DOMMatrix([o.a, o.b, o.c, o.d, o.e, o.f]);
558
+ return new Ctor([o.a, o.b, o.c, o.d, o.e, o.f]);
544
559
  }
545
- return new DOMMatrix([
560
+ return new Ctor([
546
561
  o.m11, o.m12, o.m13, o.m14,
547
562
  o.m21, o.m22, o.m23, o.m24,
548
563
  o.m31, o.m32, o.m33, o.m34,
549
564
  o.m41, o.m42, o.m43, o.m44
550
565
  ]);
551
566
  }
552
- }
553
- };
567
+ };
568
+ }
554
569
 
555
- /* globals DOMPoint */
570
+ /* globals DOMPoint, DOMPointReadOnly */
556
571
 
557
572
  /**
558
573
  * @type {import('typeson').TypeSpecSet}
559
574
  */
560
- const dompoint = {
561
- dompoint: {
562
- test (x) { return toStringTag(x) === 'DOMPoint'; },
575
+ const dompoint = {};
576
+
577
+ /* c8 ignore next */
578
+ if (typeof DOMPoint !== 'undefined') {
579
+ create$4(DOMPoint);
580
+ }
581
+ /* c8 ignore next */
582
+ if (typeof DOMPointReadOnly !== 'undefined') {
583
+ create$4(DOMPointReadOnly);
584
+ }
585
+
586
+ /**
587
+ * @param {typeof DOMPoint|typeof DOMPointReadOnly} Ctor
588
+ * @returns {void}
589
+ */
590
+ function create$4 (Ctor) {
591
+ dompoint[Ctor.name.toLowerCase()] = {
592
+ test (x) { return toStringTag(x) === Ctor.name; },
563
593
  replace (dp) {
564
594
  return {
565
595
  x: dp.x,
@@ -569,19 +599,56 @@ const dompoint = {
569
599
  };
570
600
  },
571
601
  revive ({x, y, z, w}) {
572
- return new DOMPoint(x, y, z, w);
602
+ return new Ctor(x, y, z, w);
603
+ }
604
+ };
605
+ }
606
+
607
+ /* globals DOMQuad */
608
+
609
+ /**
610
+ * @type {import('typeson').TypeSpecSet}
611
+ */
612
+ const domquad = {
613
+ domquad: {
614
+ test (x) { return toStringTag(x) === 'DOMQuad'; },
615
+ replace (dp) {
616
+ return {
617
+ p1: dp.p1,
618
+ p2: dp.p2,
619
+ p3: dp.p3,
620
+ p4: dp.p4
621
+ };
622
+ },
623
+ revive ({p1, p2, p3, p4}) {
624
+ return new DOMQuad(p1, p2, p3, p4);
573
625
  }
574
626
  }
575
627
  };
576
628
 
577
- /* globals DOMRect */
629
+ /* globals DOMRect, DOMRectReadOnly */
578
630
 
579
631
  /**
580
632
  * @type {import('typeson').TypeSpecSet}
581
633
  */
582
- const domrect = {
583
- domrect: {
584
- test (x) { return toStringTag(x) === 'DOMRect'; },
634
+ const domrect = {};
635
+
636
+ /* c8 ignore next */
637
+ if (typeof DOMRect !== 'undefined') {
638
+ create$3(DOMRect);
639
+ }
640
+ /* c8 ignore next */
641
+ if (typeof DOMRectReadOnly !== 'undefined') {
642
+ create$3(DOMRectReadOnly);
643
+ }
644
+
645
+ /**
646
+ * @param {typeof DOMRect|typeof DOMRectReadOnly} Ctor
647
+ * @returns {void}
648
+ */
649
+ function create$3 (Ctor) {
650
+ domrect[Ctor.name.toLowerCase()] = {
651
+ test (x) { return toStringTag(x) === Ctor.name; },
585
652
  replace (dr) {
586
653
  return {
587
654
  x: dr.x,
@@ -591,10 +658,10 @@ const domrect = {
591
658
  };
592
659
  },
593
660
  revive ({x, y, width, height}) {
594
- return new DOMRect(x, y, width, height);
661
+ return new Ctor(x, y, width, height);
595
662
  }
596
- }
597
- };
663
+ };
664
+ }
598
665
 
599
666
  /**
600
667
  * @type {import('typeson').TypeSpecSet}
@@ -719,12 +786,6 @@ function create$2 (Ctor) {
719
786
  e.lineNumber = obj.lineNumber;
720
787
  e.columnNumber = obj.columnNumber;
721
788
 
722
- /* c8 ignore next 6 */
723
- if (isAggregateError) {
724
- /** @type {AggregateError} */ (
725
- e
726
- ).errors = obj.errors;
727
- }
728
789
  return e;
729
790
  }
730
791
  };
@@ -1604,6 +1665,8 @@ const expObj = [
1604
1665
  /* c8 ignore next */
1605
1666
  typeof DOMPoint !== 'undefined' ? dompoint : [],
1606
1667
  /* c8 ignore next */
1668
+ typeof DOMQuad !== 'undefined' ? domquad : [],
1669
+ /* c8 ignore next */
1607
1670
  typeof DOMMatrix !== 'undefined' ? dommatrix : []
1608
1671
  );
1609
1672
 
@@ -1699,5 +1762,5 @@ const universal = [
1699
1762
  // built-in into ecmasript standard.
1700
1763
  ];
1701
1764
 
1702
- export { u as JSON_TYPES, c as Typeson, e as TypesonPromise, s as Undefined, arrayNonindexKeys, arraybuffer, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domrect, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningThrowing, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject };
1765
+ export { u as JSON_TYPES, c as Typeson, e as TypesonPromise, s as Undefined, arrayNonindexKeys, arraybuffer, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningThrowing, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject };
1703
1766
  //# sourceMappingURL=index.js.map