typeson-registry 10.0.0 → 11.0.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.md +0 -4
- package/dist/index.d.ts +1 -2
- package/dist/index.js +20 -17
- 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 +16 -12
- 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.d.ts +1 -1
- package/dist/presets/builtin.d.ts +1 -1
- package/dist/presets/postmessage.d.ts +1 -1
- package/dist/presets/socketio.d.ts +1 -1
- package/dist/presets/sparse-undefined.d.ts +1 -1
- package/dist/presets/special-numbers.d.ts +1 -1
- package/dist/presets/structured-cloning-throwing.d.ts +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.d.ts +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.d.ts +1 -1
- package/dist/presets/universal.d.ts +1 -1
- package/dist/types/arraybuffer.d.ts +1 -1
- package/dist/types/bigint-object.d.ts +1 -1
- package/dist/types/bigint.d.ts +1 -1
- package/dist/types/blob.d.ts +1 -1
- package/dist/types/blob.d.ts.map +1 -1
- package/dist/types/blob.umd.cjs +1 -1
- package/dist/types/blob.umd.cjs.map +1 -1
- package/dist/types/cloneable.d.ts +1 -1
- package/dist/types/cloneable.umd.cjs +1 -1
- package/dist/types/cloneable.umd.cjs.map +1 -1
- package/dist/types/cryptokey.d.ts +1 -1
- package/dist/types/cryptokey.d.ts.map +1 -1
- package/dist/types/cryptokey.umd.cjs.map +1 -1
- package/dist/types/dataview.d.ts +1 -1
- package/dist/types/date.d.ts +1 -1
- package/dist/types/domexception.d.ts +1 -1
- package/dist/types/dommatrix.d.ts +1 -1
- package/dist/types/dompoint.d.ts +1 -1
- package/dist/types/domquad.d.ts +1 -1
- package/dist/types/domrect.d.ts +1 -1
- package/dist/types/error.d.ts +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/file.d.ts +1 -1
- package/dist/types/file.d.ts.map +1 -1
- package/dist/types/file.umd.cjs +1 -1
- package/dist/types/file.umd.cjs.map +1 -1
- package/dist/types/filelist.d.ts +1 -1
- package/dist/types/filelist.umd.cjs +1 -1
- package/dist/types/filelist.umd.cjs.map +1 -1
- package/dist/types/imagebitmap.d.ts +1 -1
- package/dist/types/imagedata.d.ts +1 -1
- package/dist/types/infinity.d.ts +1 -1
- package/dist/types/intl-types.d.ts +3 -3
- package/dist/types/map.d.ts +1 -1
- package/dist/types/nan.d.ts +1 -1
- package/dist/types/negative-infinity.d.ts +1 -1
- package/dist/types/negative-zero.d.ts +1 -1
- package/dist/types/nonbuiltin-ignore.d.ts +1 -1
- package/dist/types/primitive-objects.d.ts +1 -1
- package/dist/types/regexp.d.ts +1 -1
- package/dist/types/resurrectable.d.ts +1 -1
- package/dist/types/resurrectable.umd.cjs +1 -1
- package/dist/types/resurrectable.umd.cjs.map +1 -1
- package/dist/types/set.d.ts +1 -1
- package/dist/types/typed-arrays-socketio.d.ts +1 -1
- package/dist/types/typed-arrays.d.ts +1 -1
- package/dist/types/undef.d.ts +1 -1
- package/dist/types/user-object.d.ts +1 -1
- package/dist/utils/generateUUID.d.ts.map +1 -1
- package/package.json +39 -39
- package/polyfills/createObjectURL.js +5 -9
- package/polyfills/createObjectURL.umd.cjs +1 -1
- package/polyfills/createObjectURL.umd.cjs.map +1 -1
- package/utils/generateUUID.js +1 -9
- package/tools/append-to-declaration-files.js +0 -13
package/dist/index.umd.cjs
CHANGED
|
@@ -1363,6 +1363,11 @@
|
|
|
1363
1363
|
* @param {ArrayBuffer} buf
|
|
1364
1364
|
* @returns {string}
|
|
1365
1365
|
*/
|
|
1366
|
+
function arraybuffer2string(buf) {
|
|
1367
|
+
return new Uint8Array(buf).reduce(function (s, _byte) {
|
|
1368
|
+
return s + String.fromCodePoint(_byte);
|
|
1369
|
+
}, '');
|
|
1370
|
+
}
|
|
1366
1371
|
|
|
1367
1372
|
/**
|
|
1368
1373
|
*
|
|
@@ -1424,7 +1429,7 @@
|
|
|
1424
1429
|
return array.buffer;
|
|
1425
1430
|
}
|
|
1426
1431
|
|
|
1427
|
-
/* globals XMLHttpRequest,
|
|
1432
|
+
/* globals XMLHttpRequest, FileReader */
|
|
1428
1433
|
|
|
1429
1434
|
/**
|
|
1430
1435
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -1470,7 +1475,7 @@
|
|
|
1470
1475
|
reader.addEventListener('load', function () {
|
|
1471
1476
|
resolve({
|
|
1472
1477
|
type: b.type,
|
|
1473
|
-
stringContents: reader.result
|
|
1478
|
+
stringContents: arraybuffer2string( /** @type {ArrayBuffer} */reader.result)
|
|
1474
1479
|
});
|
|
1475
1480
|
});
|
|
1476
1481
|
// Seems not feasible to accurately simulate
|
|
@@ -1478,14 +1483,14 @@
|
|
|
1478
1483
|
reader.addEventListener('error', function () {
|
|
1479
1484
|
reject(reader.error);
|
|
1480
1485
|
});
|
|
1481
|
-
|
|
1486
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
1487
|
+
// eslint-disable-next-line unicorn/prefer-blob-reading-methods -- Too new?
|
|
1488
|
+
reader.readAsArrayBuffer(b);
|
|
1482
1489
|
});
|
|
1483
1490
|
}
|
|
1484
1491
|
}
|
|
1485
1492
|
};
|
|
1486
1493
|
|
|
1487
|
-
// The `performance` global is optional
|
|
1488
|
-
|
|
1489
1494
|
/**
|
|
1490
1495
|
* @todo We could use `import generateUUID from 'uuid/v4';` (but it needs
|
|
1491
1496
|
* crypto library, etc.; `rollup-plugin-node-builtins` doesn't recommend
|
|
@@ -1496,10 +1501,7 @@
|
|
|
1496
1501
|
function generateUUID() {
|
|
1497
1502
|
// Adapted from original: public domain/MIT: http://stackoverflow.com/a/8809472/271577
|
|
1498
1503
|
/* c8 ignore next */
|
|
1499
|
-
var d = Date.now()
|
|
1500
|
-
// use high-precision timer if available
|
|
1501
|
-
/* c8 ignore next 4 */
|
|
1502
|
-
typeof performance !== 'undefined' && typeof performance.now === 'function' ? performance.now() : 0);
|
|
1504
|
+
var d = Date.now();
|
|
1503
1505
|
|
|
1504
1506
|
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
1505
1507
|
// eslint-disable-next-line no-use-extend-native/no-use-extend-native -- Need to update plugin
|
|
@@ -2065,7 +2067,7 @@
|
|
|
2065
2067
|
};
|
|
2066
2068
|
}
|
|
2067
2069
|
|
|
2068
|
-
/* globals XMLHttpRequest,
|
|
2070
|
+
/* globals XMLHttpRequest, FileReader */
|
|
2069
2071
|
|
|
2070
2072
|
/**
|
|
2071
2073
|
* @type {import('typeson').TypeSpecSet}
|
|
@@ -2116,7 +2118,7 @@
|
|
|
2116
2118
|
reader.addEventListener('load', function () {
|
|
2117
2119
|
resolve({
|
|
2118
2120
|
type: f.type,
|
|
2119
|
-
stringContents: reader.result,
|
|
2121
|
+
stringContents: arraybuffer2string( /** @type {ArrayBuffer} */reader.result),
|
|
2120
2122
|
name: f.name,
|
|
2121
2123
|
lastModified: f.lastModified
|
|
2122
2124
|
});
|
|
@@ -2126,7 +2128,9 @@
|
|
|
2126
2128
|
reader.addEventListener('error', function () {
|
|
2127
2129
|
reject(reader.error);
|
|
2128
2130
|
});
|
|
2129
|
-
|
|
2131
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
2132
|
+
// eslint-disable-next-line unicorn/prefer-blob-reading-methods -- Too new?
|
|
2133
|
+
reader.readAsArrayBuffer(f);
|
|
2130
2134
|
});
|
|
2131
2135
|
}
|
|
2132
2136
|
}
|