typeson-registry 11.0.0 → 11.0.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/README.md +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +21 -26
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.cjs +18 -21
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.min.cjs +1 -1
- package/dist/index.umd.min.cjs.map +1 -1
- package/dist/polyfills/createObjectURL.d.ts.map +1 -1
- package/dist/presets/array-nonindex-keys.umd.cjs.map +1 -1
- package/dist/presets/builtin.umd.cjs +1 -1
- package/dist/presets/builtin.umd.cjs.map +1 -1
- package/dist/presets/postmessage.umd.cjs.map +1 -1
- package/dist/presets/socketio.umd.cjs +1 -1
- package/dist/presets/socketio.umd.cjs.map +1 -1
- package/dist/presets/sparse-undefined.umd.cjs.map +1 -1
- package/dist/presets/special-numbers.umd.cjs.map +1 -1
- package/dist/presets/structured-cloning-throwing.umd.cjs +1 -1
- package/dist/presets/structured-cloning-throwing.umd.cjs.map +1 -1
- package/dist/presets/structured-cloning.umd.cjs +1 -1
- package/dist/presets/structured-cloning.umd.cjs.map +1 -1
- package/dist/presets/undef.umd.cjs.map +1 -1
- package/dist/presets/universal.umd.cjs +1 -1
- package/dist/presets/universal.umd.cjs.map +1 -1
- package/dist/types/arraybuffer.umd.cjs.map +1 -1
- package/dist/types/bigint-object.d.ts.map +1 -1
- package/dist/types/bigint-object.umd.cjs.map +1 -1
- package/dist/types/bigint.d.ts.map +1 -1
- package/dist/types/bigint.umd.cjs.map +1 -1
- package/dist/types/blob.umd.cjs.map +1 -1
- package/dist/types/cloneable.umd.cjs.map +1 -1
- package/dist/types/cryptokey.umd.cjs.map +1 -1
- package/dist/types/dataview.umd.cjs.map +1 -1
- package/dist/types/date.umd.cjs.map +1 -1
- package/dist/types/domexception.umd.cjs.map +1 -1
- package/dist/types/dommatrix.umd.cjs.map +1 -1
- package/dist/types/dompoint.umd.cjs.map +1 -1
- package/dist/types/domquad.umd.cjs.map +1 -1
- package/dist/types/domrect.umd.cjs.map +1 -1
- package/dist/types/error.umd.cjs.map +1 -1
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.umd.cjs.map +1 -1
- package/dist/types/file.umd.cjs.map +1 -1
- package/dist/types/filelist.umd.cjs.map +1 -1
- package/dist/types/imagebitmap.umd.cjs.map +1 -1
- package/dist/types/imagedata.umd.cjs.map +1 -1
- package/dist/types/infinity.umd.cjs.map +1 -1
- package/dist/types/intl-types.umd.cjs.map +1 -1
- package/dist/types/map.umd.cjs.map +1 -1
- package/dist/types/nan.umd.cjs.map +1 -1
- package/dist/types/negative-infinity.umd.cjs.map +1 -1
- package/dist/types/negative-zero.umd.cjs.map +1 -1
- package/dist/types/nonbuiltin-ignore.umd.cjs.map +1 -1
- package/dist/types/primitive-objects.d.ts.map +1 -1
- package/dist/types/primitive-objects.umd.cjs +1 -1
- package/dist/types/primitive-objects.umd.cjs.map +1 -1
- package/dist/types/regexp.umd.cjs.map +1 -1
- package/dist/types/resurrectable.umd.cjs.map +1 -1
- package/dist/types/set.umd.cjs.map +1 -1
- package/dist/types/typed-arrays-socketio.d.ts.map +1 -1
- package/dist/types/typed-arrays-socketio.umd.cjs.map +1 -1
- package/dist/types/typed-arrays.d.ts.map +1 -1
- package/dist/types/typed-arrays.umd.cjs.map +1 -1
- package/dist/types/undef.umd.cjs.map +1 -1
- package/dist/types/user-object.umd.cjs.map +1 -1
- package/dist/utils/generateUUID.d.ts.map +1 -1
- package/package.json +21 -32
- package/polyfills/createObjectURL.js +3 -4
- package/polyfills/createObjectURL.umd.cjs.map +1 -1
- package/utils/generateUUID.js +2 -4
package/README.md
CHANGED
|
@@ -313,7 +313,7 @@ another context).
|
|
|
313
313
|
const functionType = {functionType: [
|
|
314
314
|
function (x) { return typeof x === 'function'; },
|
|
315
315
|
function (funcType) { return '(' + funcType.toString() + ')'; },
|
|
316
|
-
// eslint-disable-next-line no-eval
|
|
316
|
+
// eslint-disable-next-line no-eval -- Demonstrating
|
|
317
317
|
function (o) { return eval(o); }
|
|
318
318
|
]};
|
|
319
319
|
|
package/dist/index.d.ts
CHANGED
|
@@ -44,4 +44,5 @@ import structuredCloning from './presets/structured-cloning.js';
|
|
|
44
44
|
import undefPreset from './presets/undef.js';
|
|
45
45
|
import universal from './presets/universal.js';
|
|
46
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 };
|
|
47
|
-
//# sourceMappingURL=index.d.ts.map
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
48
|
+
export type * from 'typeson';
|
package/dist/index.js
CHANGED
|
@@ -157,8 +157,6 @@ const bigintObject = {
|
|
|
157
157
|
},
|
|
158
158
|
replace: String,
|
|
159
159
|
revive (s) {
|
|
160
|
-
// Filed this to avoid error: https://github.com/eslint/eslint/issues/11810
|
|
161
|
-
// eslint-disable-next-line no-new-object
|
|
162
160
|
return new Object(BigInt(/** @type {string} */ (s)));
|
|
163
161
|
}
|
|
164
162
|
}
|
|
@@ -173,7 +171,8 @@ const bigint = {
|
|
|
173
171
|
return typeof x === 'bigint';
|
|
174
172
|
},
|
|
175
173
|
replace: String,
|
|
176
|
-
// eslint-disable-next-line
|
|
174
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
175
|
+
// eslint-disable-next-line unicorn/prefer-native-coercion-functions -- Clearer
|
|
177
176
|
revive (s) {
|
|
178
177
|
return BigInt(/** @type {string} */ (s));
|
|
179
178
|
}
|
|
@@ -252,7 +251,7 @@ function string2arraybuffer (str) {
|
|
|
252
251
|
return array.buffer;
|
|
253
252
|
}
|
|
254
253
|
|
|
255
|
-
/* globals XMLHttpRequest, FileReader */
|
|
254
|
+
/* globals XMLHttpRequest, FileReader -- Polyfills */
|
|
256
255
|
|
|
257
256
|
/**
|
|
258
257
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -323,14 +322,12 @@ function generateUUID () { // Adapted from original: public domain/MIT: http://
|
|
|
323
322
|
/* c8 ignore next */
|
|
324
323
|
let d = Date.now();
|
|
325
324
|
|
|
326
|
-
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
327
|
-
// eslint-disable-next-line no-use-extend-native/no-use-extend-native -- Need to update plugin
|
|
328
325
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replaceAll(/[xy]/gu, function (c) {
|
|
329
|
-
/* eslint-disable no-bitwise */
|
|
326
|
+
/* eslint-disable no-bitwise -- Convenient */
|
|
330
327
|
const r = Math.trunc((d + (Math.random() * 16)) % 16);
|
|
331
328
|
d = Math.floor(d / 16);
|
|
332
329
|
return (c === 'x' ? r : ((r & 0x3) | 0x8)).toString(16);
|
|
333
|
-
/* eslint-enable no-bitwise */
|
|
330
|
+
/* eslint-enable no-bitwise -- Convenient */
|
|
334
331
|
});
|
|
335
332
|
}
|
|
336
333
|
|
|
@@ -519,7 +516,7 @@ const domexception = {
|
|
|
519
516
|
}
|
|
520
517
|
};
|
|
521
518
|
|
|
522
|
-
/* globals DOMMatrix, DOMMatrixReadOnly */
|
|
519
|
+
/* globals DOMMatrix, DOMMatrixReadOnly -- Polyfills */
|
|
523
520
|
|
|
524
521
|
/**
|
|
525
522
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -586,7 +583,7 @@ function create$5 (Ctor) {
|
|
|
586
583
|
};
|
|
587
584
|
}
|
|
588
585
|
|
|
589
|
-
/* globals DOMPoint, DOMPointReadOnly */
|
|
586
|
+
/* globals DOMPoint, DOMPointReadOnly -- Polyfills */
|
|
590
587
|
|
|
591
588
|
/**
|
|
592
589
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -623,7 +620,7 @@ function create$4 (Ctor) {
|
|
|
623
620
|
};
|
|
624
621
|
}
|
|
625
622
|
|
|
626
|
-
/* globals DOMQuad */
|
|
623
|
+
/* globals DOMQuad -- Polyfills */
|
|
627
624
|
|
|
628
625
|
/**
|
|
629
626
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -645,7 +642,7 @@ const domquad = {
|
|
|
645
642
|
}
|
|
646
643
|
};
|
|
647
644
|
|
|
648
|
-
/* globals DOMRect, DOMRectReadOnly */
|
|
645
|
+
/* globals DOMRect, DOMRectReadOnly -- Polyfills */
|
|
649
646
|
|
|
650
647
|
/**
|
|
651
648
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -718,8 +715,7 @@ const error = {
|
|
|
718
715
|
}
|
|
719
716
|
};
|
|
720
717
|
|
|
721
|
-
/* globals InternalError */
|
|
722
|
-
/* eslint-env browser, node */
|
|
718
|
+
/* globals InternalError -- Optional */
|
|
723
719
|
|
|
724
720
|
/**
|
|
725
721
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -810,7 +806,7 @@ function create$2 (Ctor) {
|
|
|
810
806
|
};
|
|
811
807
|
}
|
|
812
808
|
|
|
813
|
-
/* globals XMLHttpRequest, FileReader */
|
|
809
|
+
/* globals XMLHttpRequest, FileReader -- Polyfills */
|
|
814
810
|
|
|
815
811
|
/**
|
|
816
812
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -897,7 +893,7 @@ const filelist = {
|
|
|
897
893
|
* Set private properties and length.
|
|
898
894
|
*/
|
|
899
895
|
constructor () {
|
|
900
|
-
// eslint-disable-next-line prefer-rest-params
|
|
896
|
+
// eslint-disable-next-line prefer-rest-params -- API
|
|
901
897
|
this._files = arguments[0];
|
|
902
898
|
this.length = this._files.length;
|
|
903
899
|
}
|
|
@@ -908,12 +904,12 @@ const filelist = {
|
|
|
908
904
|
item (index) {
|
|
909
905
|
return this._files[index];
|
|
910
906
|
}
|
|
911
|
-
/* eslint-disable class-methods-use-this */
|
|
907
|
+
/* eslint-disable class-methods-use-this -- Not needed */
|
|
912
908
|
/**
|
|
913
909
|
* @returns {"FileList"}
|
|
914
910
|
*/
|
|
915
911
|
get [Symbol.toStringTag] () {
|
|
916
|
-
/* eslint-enable class-methods-use-this */
|
|
912
|
+
/* eslint-enable class-methods-use-this -- Not needed */
|
|
917
913
|
return 'FileList';
|
|
918
914
|
}
|
|
919
915
|
}
|
|
@@ -922,7 +918,7 @@ const filelist = {
|
|
|
922
918
|
}
|
|
923
919
|
};
|
|
924
920
|
|
|
925
|
-
/* globals document, OffscreenCanvas, createImageBitmap */
|
|
921
|
+
/* globals document, OffscreenCanvas, createImageBitmap -- Polyfills */
|
|
926
922
|
// `ImageBitmap` is browser / DOM specific. It also can only work
|
|
927
923
|
// same-domain (or CORS)
|
|
928
924
|
|
|
@@ -1005,7 +1001,7 @@ const imagebitmap = {
|
|
|
1005
1001
|
}
|
|
1006
1002
|
};
|
|
1007
1003
|
|
|
1008
|
-
/* globals ImageData */
|
|
1004
|
+
/* globals ImageData -- Polyfills */
|
|
1009
1005
|
// `ImageData` is browser / DOM specific (though `node-canvas` has it
|
|
1010
1006
|
// available on `Canvas`).
|
|
1011
1007
|
|
|
@@ -1163,7 +1159,7 @@ const nonbuiltinIgnore = {
|
|
|
1163
1159
|
|
|
1164
1160
|
// This module is for objectified primitives (such as `new Number(3)` or
|
|
1165
1161
|
// `new String("foo")`)
|
|
1166
|
-
/* eslint-disable no-new-wrappers, unicorn/new-for-builtins */
|
|
1162
|
+
/* eslint-disable no-new-wrappers, unicorn/new-for-builtins -- Deliberate */
|
|
1167
1163
|
|
|
1168
1164
|
/**
|
|
1169
1165
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -1183,7 +1179,10 @@ const primitiveObjects = {
|
|
|
1183
1179
|
return toStringTag(x) === 'Boolean' &&
|
|
1184
1180
|
typeof x === 'object';
|
|
1185
1181
|
},
|
|
1186
|
-
replace
|
|
1182
|
+
replace (o) {
|
|
1183
|
+
// convert to primitive boolean
|
|
1184
|
+
return o.valueOf();
|
|
1185
|
+
},
|
|
1187
1186
|
revive (b) {
|
|
1188
1187
|
// Revive to an objectified Boolean
|
|
1189
1188
|
return new Boolean(b);
|
|
@@ -1266,8 +1265,6 @@ const set = {
|
|
|
1266
1265
|
}
|
|
1267
1266
|
};
|
|
1268
1267
|
|
|
1269
|
-
/* eslint-env browser, node */
|
|
1270
|
-
|
|
1271
1268
|
// Support all kinds of typed arrays (views of ArrayBuffers)
|
|
1272
1269
|
|
|
1273
1270
|
/**
|
|
@@ -1334,8 +1331,6 @@ if (typeof Int8Array === 'function') {
|
|
|
1334
1331
|
].forEach((TypedArray) => create$1(TypedArray));
|
|
1335
1332
|
}
|
|
1336
1333
|
|
|
1337
|
-
/* eslint-env browser, node */
|
|
1338
|
-
|
|
1339
1334
|
/**
|
|
1340
1335
|
* @type {import('typeson').TypeSpecSet}
|
|
1341
1336
|
*/
|