@loaders.gl/crypto 3.0.10 → 3.0.14
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/dist.es5.min.js +1 -1
- package/dist/dist.es5.min.js.map +1 -1
- package/dist/dist.min.js +1 -1
- package/dist/dist.min.js.map +1 -1
- package/dist/es5/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/utils/base64-utils.js +1 -1
- package/dist/esm/lib/utils/base64-utils.js.map +1 -1
- package/dist/esm/lib/utils/digest-utils.js +2 -2
- package/dist/esm/lib/utils/digest-utils.js.map +1 -1
- package/dist/esm/workers/worker.js +1 -1
- package/dist/esm/workers/worker.js.map +1 -1
- package/dist/worker.js +177 -36
- package/dist/worker.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/utils/base64-utils.js"],"names":["toBase64","string","i","length","charCodeAt","out","groupsOfSix","undefined","j","btoaLookup","idx","String","fromCharCode"],"mappings":"AAIA,OAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0B;AAE/BA,EAAAA,MAAM,
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/base64-utils.js"],"names":["toBase64","string","i","length","charCodeAt","out","groupsOfSix","undefined","j","btoaLookup","idx","String","fromCharCode"],"mappings":"AAIA,OAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0B;AAE/BA,EAAAA,MAAM,aAAMA,MAAN,CAAN;;AAGA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,MAAM,CAACE,MAA3B,EAAmCD,CAAC,EAApC,EAAwC;AACtC,QAAID,MAAM,CAACG,UAAP,CAAkBF,CAAlB,IAAuB,GAA3B,EAAgC;AAC9B,aAAO,IAAP;AACD;AACF;;AACD,MAAIG,GAAG,GAAG,EAAV;;AACA,OAAK,IAAIH,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,MAAM,CAACE,MAA3B,EAAmCD,CAAC,IAAI,CAAxC,EAA2C;AAEzC,UAAMI,WAAW,GAAG,CAACC,SAAD,EAAYA,SAAZ,EAAuBA,SAAvB,EAAkCA,SAAlC,CAApB;AACAD,IAAAA,WAAW,CAAC,CAAD,CAAX,GAAiBL,MAAM,CAACG,UAAP,CAAkBF,CAAlB,KAAwB,CAAzC;AACAI,IAAAA,WAAW,CAAC,CAAD,CAAX,GAAiB,CAACL,MAAM,CAACG,UAAP,CAAkBF,CAAlB,IAAuB,IAAxB,KAAiC,CAAlD;;AACA,QAAID,MAAM,CAACE,MAAP,GAAgBD,CAAC,GAAG,CAAxB,EAA2B;AACzBI,MAAAA,WAAW,CAAC,CAAD,CAAX,IAAkBL,MAAM,CAACG,UAAP,CAAkBF,CAAC,GAAG,CAAtB,KAA4B,CAA9C;AACAI,MAAAA,WAAW,CAAC,CAAD,CAAX,GAAiB,CAACL,MAAM,CAACG,UAAP,CAAkBF,CAAC,GAAG,CAAtB,IAA2B,IAA5B,KAAqC,CAAtD;AACD;;AACD,QAAID,MAAM,CAACE,MAAP,GAAgBD,CAAC,GAAG,CAAxB,EAA2B;AACzBI,MAAAA,WAAW,CAAC,CAAD,CAAX,IAAkBL,MAAM,CAACG,UAAP,CAAkBF,CAAC,GAAG,CAAtB,KAA4B,CAA9C;AACAI,MAAAA,WAAW,CAAC,CAAD,CAAX,GAAiBL,MAAM,CAACG,UAAP,CAAkBF,CAAC,GAAG,CAAtB,IAA2B,IAA5C;AACD;;AACD,SAAK,IAAIM,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,WAAW,CAACH,MAAhC,EAAwCK,CAAC,EAAzC,EAA6C;AAC3C,UAAI,OAAOF,WAAW,CAACE,CAAD,CAAlB,KAA0B,WAA9B,EAA2C;AACzCH,QAAAA,GAAG,IAAI,GAAP;AACD,OAFD,MAEO;AACLA,QAAAA,GAAG,IAAII,UAAU,CAACH,WAAW,CAACE,CAAD,CAAZ,CAAjB;AACD;AACF;AACF;;AACD,SAAOH,GAAP;AACD;;AAMD,SAASI,UAAT,CAAoBC,GAApB,EAAyB;AACvB,MAAIA,GAAG,GAAG,EAAV,EAAc;AACZ,WAAOC,MAAM,CAACC,YAAP,CAAoBF,GAAG,GAAG,IAAIN,UAAJ,CAAe,CAAf,CAA1B,CAAP;AACD;;AACD,MAAIM,GAAG,GAAG,EAAV,EAAc;AACZ,WAAOC,MAAM,CAACC,YAAP,CAAoBF,GAAG,GAAG,EAAN,GAAW,IAAIN,UAAJ,CAAe,CAAf,CAA/B,CAAP;AACD;;AACD,MAAIM,GAAG,GAAG,EAAV,EAAc;AACZ,WAAOC,MAAM,CAACC,YAAP,CAAoBF,GAAG,GAAG,EAAN,GAAW,IAAIN,UAAJ,CAAe,CAAf,CAA/B,CAAP;AACD;;AACD,MAAIM,GAAG,KAAK,EAAZ,EAAgB;AACd,WAAO,GAAP;AACD;;AACD,MAAIA,GAAG,KAAK,EAAZ,EAAgB;AACd,WAAO,GAAP;AACD;;AAED,SAAOH,SAAP;AACD","sourcesContent":["/**\n * `btoa()` polyfill as defined by the HTML and Infra specs, which mostly just references\n * RFC 4648.\n */\nexport function toBase64(string) {\n // String conversion as required by Web IDL.\n string = `${string}`;\n // \"The btoa() method must throw an \"InvalidCharacterError\" DOMException if\n // data contains any character whose code point is greater than U+00FF.\"\n for (let i = 0; i < string.length; i++) {\n if (string.charCodeAt(i) > 255) {\n return null;\n }\n }\n let out = '';\n for (let i = 0; i < string.length; i += 3) {\n /** @type {Array[4]} */\n const groupsOfSix = [undefined, undefined, undefined, undefined];\n groupsOfSix[0] = string.charCodeAt(i) >> 2;\n groupsOfSix[1] = (string.charCodeAt(i) & 0x03) << 4;\n if (string.length > i + 1) {\n groupsOfSix[1] |= string.charCodeAt(i + 1) >> 4;\n groupsOfSix[2] = (string.charCodeAt(i + 1) & 0x0f) << 2;\n }\n if (string.length > i + 2) {\n groupsOfSix[2] |= string.charCodeAt(i + 2) >> 6;\n groupsOfSix[3] = string.charCodeAt(i + 2) & 0x3f;\n }\n for (let j = 0; j < groupsOfSix.length; j++) {\n if (typeof groupsOfSix[j] === 'undefined') {\n out += '=';\n } else {\n out += btoaLookup(groupsOfSix[j]);\n }\n }\n }\n return out;\n}\n\n/**\n * Lookup table for btoa(), which converts a six-bit number into the\n * corresponding ASCII character.\n */\nfunction btoaLookup(idx) {\n if (idx < 26) {\n return String.fromCharCode(idx + 'A'.charCodeAt(0));\n }\n if (idx < 52) {\n return String.fromCharCode(idx - 26 + 'a'.charCodeAt(0));\n }\n if (idx < 62) {\n return String.fromCharCode(idx - 52 + '0'.charCodeAt(0));\n }\n if (idx === 62) {\n return '+';\n }\n if (idx === 63) {\n return '/';\n }\n // Throw INVALID_CHARACTER_ERR exception here -- won't be hit in the teststring.\n return undefined;\n}\n"],"file":"base64-utils.js"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { toBase64 } from './base64-utils';
|
|
2
2
|
export function toHex(cipher) {
|
|
3
3
|
const hexString = cipher.toString(16);
|
|
4
|
-
return hexString === '0' ?
|
|
4
|
+
return hexString === '0' ? "0".concat(hexString) : hexString;
|
|
5
5
|
}
|
|
6
6
|
export function hexToBase64(hexstring) {
|
|
7
7
|
if (hexstring.length % 2 !== 0) {
|
|
8
|
-
hexstring =
|
|
8
|
+
hexstring = "0".concat(hexstring);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const string = hexstring.match(/\w{2}/g).map(a => String.fromCharCode(parseInt(a, 16))).join('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/utils/digest-utils.js"],"names":["toBase64","toHex","cipher","hexString","toString","hexToBase64","hexstring","length","string","match","map","a","String","fromCharCode","parseInt","join"],"mappings":"AAAA,SAAQA,QAAR,QAAuB,gBAAvB;AAKA,OAAO,SAASC,KAAT,CAAeC,MAAf,EAAuB;AAC5B,QAAMC,SAAS,GAAGD,MAAM,CAACE,QAAP,CAAgB,EAAhB,CAAlB;AACA,SAAOD,SAAS,KAAK,GAAd,
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/digest-utils.js"],"names":["toBase64","toHex","cipher","hexString","toString","hexToBase64","hexstring","length","string","match","map","a","String","fromCharCode","parseInt","join"],"mappings":"AAAA,SAAQA,QAAR,QAAuB,gBAAvB;AAKA,OAAO,SAASC,KAAT,CAAeC,MAAf,EAAuB;AAC5B,QAAMC,SAAS,GAAGD,MAAM,CAACE,QAAP,CAAgB,EAAhB,CAAlB;AACA,SAAOD,SAAS,KAAK,GAAd,cAAwBA,SAAxB,IAAsCA,SAA7C;AACD;AAKD,OAAO,SAASE,WAAT,CAAqBC,SAArB,EAAgC;AAGrC,MAAIA,SAAS,CAACC,MAAV,GAAmB,CAAnB,KAAyB,CAA7B,EAAgC;AAC9BD,IAAAA,SAAS,cAAOA,SAAP,CAAT;AACD;;AACD,QAAME,MAAM,GAAGF,SAAS,CACrBG,KADY,CACN,QADM,EAEZC,GAFY,CAEPC,CAAD,IAAOC,MAAM,CAACC,YAAP,CAAoBC,QAAQ,CAACH,CAAD,EAAI,EAAJ,CAA5B,CAFC,EAGZI,IAHY,CAGP,EAHO,CAAf;AAIA,SAAOf,QAAQ,CAACQ,MAAD,CAAf;AACD","sourcesContent":["import {toBase64} from './base64-utils';\n\n/**\n *\n */\nexport function toHex(cipher) {\n const hexString = cipher.toString(16);\n return hexString === '0' ? `0${hexString}` : hexString;\n}\n\n/**\n *\n */\nexport function hexToBase64(hexstring) {\n // Add leading zero to keep even count of digits\n // eg. f85d741 => 0f85d741\n if (hexstring.length % 2 !== 0) {\n hexstring = `0${hexstring}`;\n }\n const string = hexstring\n .match(/\\w{2}/g)\n .map((a) => String.fromCharCode(parseInt(a, 16)))\n .join('');\n return toBase64(string);\n}\n"],"file":"digest-utils.js"}
|
|
@@ -19,7 +19,7 @@ createWorker(async (data, options = {}) => {
|
|
|
19
19
|
return await new MD5Hash(options).hash(data);
|
|
20
20
|
|
|
21
21
|
default:
|
|
22
|
-
throw new Error(
|
|
22
|
+
throw new Error("invalid option: ".concat(operation));
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
//# sourceMappingURL=worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/workers/worker.ts"],"names":["createWorker","CRC32Hash","CRC32CHash","MD5Hash","data","options","operation","hash","Error"],"mappings":"AAAA,SAAQA,YAAR,QAA2B,0BAA3B;AACA,SAAQC,SAAR,QAAwB,mBAAxB;AACA,SAAQC,UAAR,QAAyB,oBAAzB;AACA,SAAQC,OAAR,QAAsB,iBAAtB;AAGA,SAAQF,SAAR,EAAmBC,UAAnB;AAEAF,YAAY,CAAC,OAAOI,IAAP,EAAaC,OAAO,GAAG,EAAvB,KAA8B;AAEzC,QAAM;AAACC,IAAAA;AAAD,MAAcD,OAApB;;AAEA,UAAQC,SAAR;AACE,SAAK,OAAL;AACE,aAAO,MAAM,IAAIL,SAAJ,CAAcI,OAAd,EAAuBE,IAAvB,CAA4BH,IAA5B,CAAb;;AACF,SAAK,QAAL;AACE,aAAO,MAAM,IAAIF,UAAJ,CAAeG,OAAf,EAAwBE,IAAxB,CAA6BH,IAA7B,CAAb;;AACF,SAAK,KAAL;AACE,aAAO,MAAM,IAAID,OAAJ,CAAYE,OAAZ,EAAqBE,IAArB,CAA0BH,IAA1B,CAAb;;AACF;AACE,YAAM,IAAII,KAAJ,
|
|
1
|
+
{"version":3,"sources":["../../../src/workers/worker.ts"],"names":["createWorker","CRC32Hash","CRC32CHash","MD5Hash","data","options","operation","hash","Error"],"mappings":"AAAA,SAAQA,YAAR,QAA2B,0BAA3B;AACA,SAAQC,SAAR,QAAwB,mBAAxB;AACA,SAAQC,UAAR,QAAyB,oBAAzB;AACA,SAAQC,OAAR,QAAsB,iBAAtB;AAGA,SAAQF,SAAR,EAAmBC,UAAnB;AAEAF,YAAY,CAAC,OAAOI,IAAP,EAAaC,OAAO,GAAG,EAAvB,KAA8B;AAEzC,QAAM;AAACC,IAAAA;AAAD,MAAcD,OAApB;;AAEA,UAAQC,SAAR;AACE,SAAK,OAAL;AACE,aAAO,MAAM,IAAIL,SAAJ,CAAcI,OAAd,EAAuBE,IAAvB,CAA4BH,IAA5B,CAAb;;AACF,SAAK,QAAL;AACE,aAAO,MAAM,IAAIF,UAAJ,CAAeG,OAAf,EAAwBE,IAAxB,CAA6BH,IAA7B,CAAb;;AACF,SAAK,KAAL;AACE,aAAO,MAAM,IAAID,OAAJ,CAAYE,OAAZ,EAAqBE,IAArB,CAA0BH,IAA1B,CAAb;;AACF;AACE,YAAM,IAAII,KAAJ,2BAA6BF,SAA7B,EAAN;AARJ;AAUD,CAdW,CAAZ","sourcesContent":["import {createWorker} from '@loaders.gl/worker-utils';\nimport {CRC32Hash} from '../lib/crc32-hash';\nimport {CRC32CHash} from '../lib/crc32c-hash';\nimport {MD5Hash} from '../lib/md5-hash';\n\n// Assuming we can bundle as module\nexport {CRC32Hash, CRC32CHash};\n\ncreateWorker(async (data, options = {}) => {\n // @ts-ignore\n const {operation} = options;\n\n switch (operation) {\n case 'crc32':\n return await new CRC32Hash(options).hash(data);\n case 'crc32c':\n return await new CRC32CHash(options).hash(data);\n case 'md5':\n return await new MD5Hash(options).hash(data);\n default:\n throw new Error(`invalid option: ${operation}`);\n }\n});\n"],"file":"worker.js"}
|
package/dist/worker.js
CHANGED
|
@@ -629,7 +629,7 @@ module.exports = g;
|
|
|
629
629
|
/*!************************************!*\
|
|
630
630
|
!*** ../loader-utils/src/index.ts ***!
|
|
631
631
|
\************************************/
|
|
632
|
-
/*! exports provided: assert, isBrowser, isWorker, nodeVersion, self, window, global, document, createLoaderWorker, parseWithWorker, canParseWithWorker, parseJSON, toArrayBuffer, sliceArrayBuffer, concatenateArrayBuffers, concatenateTypedArrays, compareArrayBuffers, padToNBytes, copyToArray, copyArrayBuffer, copyPaddedArrayBufferToDataView, copyPaddedStringToDataView, padStringToByteAlignment, copyStringToDataView, copyBinaryToDataView, getFirstCharacters, getMagicString, makeTextEncoderIterator, makeTextDecoderIterator, makeLineIterator, makeNumberedLineIterator, forEach, concatenateArrayBuffersAsync, RequestScheduler,
|
|
632
|
+
/*! exports provided: assert, isBrowser, isWorker, nodeVersion, self, window, global, document, createLoaderWorker, parseWithWorker, canParseWithWorker, parseJSON, toArrayBuffer, sliceArrayBuffer, concatenateArrayBuffers, concatenateTypedArrays, compareArrayBuffers, padToNBytes, copyToArray, copyArrayBuffer, copyPaddedArrayBufferToDataView, copyPaddedStringToDataView, padStringToByteAlignment, copyStringToDataView, copyBinaryToDataView, getFirstCharacters, getMagicString, makeTextEncoderIterator, makeTextDecoderIterator, makeLineIterator, makeNumberedLineIterator, forEach, concatenateArrayBuffersAsync, RequestScheduler, setPathPrefix, getPathPrefix, resolvePath, _addAliases, JSONLoader, path, isBuffer, toBuffer, bufferToArrayBuffer, util, promisify, fs, _NodeFileSystem */
|
|
633
633
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
634
634
|
|
|
635
635
|
"use strict";
|
|
@@ -715,20 +715,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
715
715
|
/* harmony import */ var _lib_request_utils_request_scheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./lib/request-utils/request-scheduler */ "../loader-utils/src/lib/request-utils/request-scheduler.ts");
|
|
716
716
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RequestScheduler", function() { return _lib_request_utils_request_scheduler__WEBPACK_IMPORTED_MODULE_12__["default"]; });
|
|
717
717
|
|
|
718
|
-
/* harmony import */ var
|
|
719
|
-
/* harmony reexport (
|
|
720
|
-
/* harmony import */ var _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./lib/path-utils/file-aliases */ "../loader-utils/src/lib/path-utils/file-aliases.ts");
|
|
721
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setPathPrefix", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_14__["setPathPrefix"]; });
|
|
718
|
+
/* harmony import */ var _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lib/path-utils/file-aliases */ "../loader-utils/src/lib/path-utils/file-aliases.ts");
|
|
719
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setPathPrefix", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_13__["setPathPrefix"]; });
|
|
722
720
|
|
|
723
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPathPrefix", function() { return
|
|
721
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPathPrefix", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_13__["getPathPrefix"]; });
|
|
724
722
|
|
|
725
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvePath", function() { return
|
|
723
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvePath", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_13__["resolvePath"]; });
|
|
726
724
|
|
|
727
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_addAliases", function() { return
|
|
725
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_addAliases", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_13__["addAliases"]; });
|
|
728
726
|
|
|
729
|
-
/* harmony import */ var
|
|
730
|
-
/* harmony
|
|
731
|
-
|
|
727
|
+
/* harmony import */ var _json_loader__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./json-loader */ "../loader-utils/src/json-loader.ts");
|
|
728
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JSONLoader", function() { return _json_loader__WEBPACK_IMPORTED_MODULE_14__["JSONLoader"]; });
|
|
729
|
+
|
|
730
|
+
/* harmony import */ var _lib_path_utils_path__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./lib/path-utils/path */ "../loader-utils/src/lib/path-utils/path.ts");
|
|
731
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "path", function() { return _lib_path_utils_path__WEBPACK_IMPORTED_MODULE_15__; });
|
|
732
732
|
/* harmony import */ var _lib_binary_utils_buffer_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lib/binary-utils/buffer-utils */ "../loader-utils/src/lib/binary-utils/buffer-utils.ts");
|
|
733
733
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _lib_binary_utils_buffer_utils__WEBPACK_IMPORTED_MODULE_16__["isBuffer"]; });
|
|
734
734
|
|
|
@@ -736,8 +736,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
736
736
|
|
|
737
737
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToArrayBuffer", function() { return _lib_binary_utils_buffer_utils__WEBPACK_IMPORTED_MODULE_16__["bufferToArrayBuffer"]; });
|
|
738
738
|
|
|
739
|
-
/* harmony import */ var
|
|
740
|
-
/* harmony
|
|
739
|
+
/* harmony import */ var _lib_node_util__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./lib/node/util */ 3);
|
|
740
|
+
/* harmony import */ var _lib_node_util__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_lib_node_util__WEBPACK_IMPORTED_MODULE_17__);
|
|
741
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return _lib_node_util__WEBPACK_IMPORTED_MODULE_17__; });
|
|
742
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "promisify", function() { return _lib_node_util__WEBPACK_IMPORTED_MODULE_17__["promisify"]; });
|
|
743
|
+
|
|
744
|
+
/* harmony import */ var _lib_node_fs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./lib/node/fs */ 4);
|
|
745
|
+
/* harmony import */ var _lib_node_fs__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_lib_node_fs__WEBPACK_IMPORTED_MODULE_18__);
|
|
746
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "fs", function() { return _lib_node_fs__WEBPACK_IMPORTED_MODULE_18__; });
|
|
747
|
+
/* harmony import */ var _lib_filesystems_node_filesystem__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lib/filesystems/node-filesystem */ "../loader-utils/src/lib/filesystems/node-filesystem.ts");
|
|
748
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_NodeFileSystem", function() { return _lib_filesystems_node_filesystem__WEBPACK_IMPORTED_MODULE_19__["default"]; });
|
|
741
749
|
|
|
742
750
|
// TYPES
|
|
743
751
|
// GENERAL UTILS
|
|
@@ -758,17 +766,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
758
766
|
|
|
759
767
|
// REQUEST UTILS
|
|
760
768
|
|
|
761
|
-
//
|
|
769
|
+
// PATH HELPERS
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
// MICRO LOADERS
|
|
773
|
+
|
|
774
|
+
// NODE support
|
|
775
|
+
// Node.js emulation (can be used in browser)
|
|
776
|
+
// `path` replacement (avoids bundling big path polyfill)
|
|
762
777
|
|
|
763
778
|
|
|
779
|
+
// Avoid direct use of `Buffer` which pulls in 50KB polyfill
|
|
764
780
|
|
|
781
|
+
// Note.js wrappers (can be safely imported, but not used in browser)
|
|
782
|
+
// Use instead of importing 'util'
|
|
765
783
|
|
|
766
|
-
// NODE `fs` WRAPPERS
|
|
767
784
|
|
|
785
|
+
// TODO - remove
|
|
768
786
|
|
|
769
|
-
//
|
|
787
|
+
// Use instead of importing 'fs';`
|
|
770
788
|
|
|
771
789
|
|
|
790
|
+
// EXPERIMENTAL
|
|
791
|
+
|
|
772
792
|
|
|
773
793
|
|
|
774
794
|
/***/ }),
|
|
@@ -786,7 +806,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
786
806
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_typecheckJSONLoader", function() { return _typecheckJSONLoader; });
|
|
787
807
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
788
808
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
789
|
-
const VERSION = true ? "3.0.
|
|
809
|
+
const VERSION = true ? "3.0.14" : undefined;
|
|
790
810
|
/**
|
|
791
811
|
* A JSON Micro loader (minimal bundle size)
|
|
792
812
|
* Alternative to `@loaders.gl/json`
|
|
@@ -828,8 +848,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
828
848
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatenateArrayBuffers", function() { return concatenateArrayBuffers; });
|
|
829
849
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatenateTypedArrays", function() { return concatenateTypedArrays; });
|
|
830
850
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sliceArrayBuffer", function() { return sliceArrayBuffer; });
|
|
831
|
-
/* harmony import */ var
|
|
832
|
-
/* harmony import */ var _node_buffer_utils_node__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_buffer_utils_node__WEBPACK_IMPORTED_MODULE_0__);
|
|
851
|
+
/* harmony import */ var _buffer_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./buffer-utils */ "../loader-utils/src/lib/binary-utils/buffer-utils.ts");
|
|
833
852
|
|
|
834
853
|
/**
|
|
835
854
|
* Convert an object to an array buffer
|
|
@@ -837,18 +856,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
837
856
|
|
|
838
857
|
function toArrayBuffer(data) {
|
|
839
858
|
// Note: Should be called first, Buffers can trigger other detections below
|
|
840
|
-
if (
|
|
859
|
+
if (_buffer_utils__WEBPACK_IMPORTED_MODULE_0__["isBuffer"](data)) {
|
|
841
860
|
// TODO - per docs we should just be able to call buffer.buffer, but there are issues
|
|
842
|
-
data =
|
|
861
|
+
data = _buffer_utils__WEBPACK_IMPORTED_MODULE_0__["bufferToArrayBuffer"](data);
|
|
843
862
|
}
|
|
844
863
|
|
|
845
864
|
if (data instanceof ArrayBuffer) {
|
|
846
865
|
return data;
|
|
847
|
-
} // Careful - Node Buffers
|
|
866
|
+
} // Careful - Node Buffers look like Uint8Arrays (keep after isBuffer)
|
|
848
867
|
|
|
849
868
|
|
|
850
869
|
if (ArrayBuffer.isView(data)) {
|
|
851
|
-
|
|
870
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
871
|
+
return data.buffer;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
852
875
|
}
|
|
853
876
|
|
|
854
877
|
if (typeof data === 'string') {
|
|
@@ -1033,8 +1056,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1033
1056
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return isBuffer; });
|
|
1034
1057
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBuffer", function() { return toBuffer; });
|
|
1035
1058
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToArrayBuffer", function() { return bufferToArrayBuffer; });
|
|
1036
|
-
/* harmony import */ var
|
|
1037
|
-
/* harmony import */ var
|
|
1059
|
+
/* harmony import */ var _node_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node/buffer */ 2);
|
|
1060
|
+
/* harmony import */ var _node_buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_buffer__WEBPACK_IMPORTED_MODULE_0__);
|
|
1038
1061
|
|
|
1039
1062
|
/**
|
|
1040
1063
|
* Check for Node.js `Buffer` (without triggering bundler to include Buffer polyfill on browser)
|
|
@@ -1049,7 +1072,7 @@ function isBuffer(value) {
|
|
|
1049
1072
|
*/
|
|
1050
1073
|
|
|
1051
1074
|
function toBuffer(data) {
|
|
1052
|
-
return
|
|
1075
|
+
return _node_buffer__WEBPACK_IMPORTED_MODULE_0__["toBuffer"] ? _node_buffer__WEBPACK_IMPORTED_MODULE_0__["toBuffer"](data) : data;
|
|
1053
1076
|
}
|
|
1054
1077
|
/**
|
|
1055
1078
|
* Converts Node.js `Buffer` to `ArrayBuffer` (without triggering bundler to include Buffer polyfill on browser)
|
|
@@ -1057,9 +1080,9 @@ function toBuffer(data) {
|
|
|
1057
1080
|
*/
|
|
1058
1081
|
|
|
1059
1082
|
function bufferToArrayBuffer(data) {
|
|
1060
|
-
if (
|
|
1083
|
+
if (_node_buffer__WEBPACK_IMPORTED_MODULE_0__["toArrayBuffer"]) {
|
|
1061
1084
|
// TODO - per docs we should just be able to call buffer.buffer, but there are issues
|
|
1062
|
-
return
|
|
1085
|
+
return _node_buffer__WEBPACK_IMPORTED_MODULE_0__["toArrayBuffer"](data);
|
|
1063
1086
|
}
|
|
1064
1087
|
|
|
1065
1088
|
return data;
|
|
@@ -1303,6 +1326,91 @@ const nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
|
1303
1326
|
|
|
1304
1327
|
/***/ }),
|
|
1305
1328
|
|
|
1329
|
+
/***/ "../loader-utils/src/lib/filesystems/node-filesystem.ts":
|
|
1330
|
+
/*!**************************************************************!*\
|
|
1331
|
+
!*** ../loader-utils/src/lib/filesystems/node-filesystem.ts ***!
|
|
1332
|
+
\**************************************************************/
|
|
1333
|
+
/*! exports provided: default */
|
|
1334
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1335
|
+
|
|
1336
|
+
"use strict";
|
|
1337
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1338
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NodeFileSystem; });
|
|
1339
|
+
/* harmony import */ var _node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node/fs */ 5);
|
|
1340
|
+
/* harmony import */ var _node_fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* FileSystem pass-through for Node.js
|
|
1345
|
+
* Compatible with BrowserFileSystem.
|
|
1346
|
+
* @param options
|
|
1347
|
+
*/
|
|
1348
|
+
class NodeFileSystem {
|
|
1349
|
+
// implements IFileSystem
|
|
1350
|
+
constructor(options) {
|
|
1351
|
+
this.fetch = options._fetch;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
async readdir(dirname = '.', options) {
|
|
1355
|
+
return await _node_fs__WEBPACK_IMPORTED_MODULE_0__["readdir"](dirname, options);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
async stat(path, options) {
|
|
1359
|
+
const info = await _node_fs__WEBPACK_IMPORTED_MODULE_0__["stat"](path, options);
|
|
1360
|
+
return {
|
|
1361
|
+
size: Number(info.size),
|
|
1362
|
+
isDirectory: () => false,
|
|
1363
|
+
info
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
async fetch(path, options) {
|
|
1368
|
+
// Falls back to handle https:/http:/data: etc fetches
|
|
1369
|
+
// eslint-disable-next-line
|
|
1370
|
+
const fallbackFetch = options.fetch || this.fetch;
|
|
1371
|
+
return fallbackFetch(path, options);
|
|
1372
|
+
} // implements IRandomAccessFileSystem
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
async open(path, flags, mode) {
|
|
1376
|
+
return await _node_fs__WEBPACK_IMPORTED_MODULE_0__["open"](path, flags);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
async close(fd) {
|
|
1380
|
+
return await _node_fs__WEBPACK_IMPORTED_MODULE_0__["close"](fd);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
async fstat(fd) {
|
|
1384
|
+
const info = await _node_fs__WEBPACK_IMPORTED_MODULE_0__["fstat"](fd);
|
|
1385
|
+
return info;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
async read(fd, // @ts-ignore Possibly null
|
|
1389
|
+
{
|
|
1390
|
+
buffer = null,
|
|
1391
|
+
offset = 0,
|
|
1392
|
+
length = buffer.byteLength,
|
|
1393
|
+
position = null
|
|
1394
|
+
}) {
|
|
1395
|
+
let totalBytesRead = 0; // Read in loop until we get required number of bytes
|
|
1396
|
+
|
|
1397
|
+
while (totalBytesRead < length) {
|
|
1398
|
+
const {
|
|
1399
|
+
bytesRead
|
|
1400
|
+
} = await _node_fs__WEBPACK_IMPORTED_MODULE_0__["read"](fd, buffer, offset + totalBytesRead, length - totalBytesRead, position + totalBytesRead);
|
|
1401
|
+
totalBytesRead += bytesRead;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
return {
|
|
1405
|
+
bytesRead: totalBytesRead,
|
|
1406
|
+
buffer
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
/***/ }),
|
|
1413
|
+
|
|
1306
1414
|
/***/ "../loader-utils/src/lib/iterators/async-iteration.ts":
|
|
1307
1415
|
/*!************************************************************!*\
|
|
1308
1416
|
!*** ../loader-utils/src/lib/iterators/async-iteration.ts ***!
|
|
@@ -2372,7 +2480,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2372
2480
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
2373
2481
|
// Change to `latest` on production branches
|
|
2374
2482
|
const DEFAULT_VERSION = 'beta';
|
|
2375
|
-
const VERSION = true ? "3.0.
|
|
2483
|
+
const VERSION = true ? "3.0.14" : undefined;
|
|
2376
2484
|
|
|
2377
2485
|
if (false) {}
|
|
2378
2486
|
|
|
@@ -2401,7 +2509,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2401
2509
|
// TODO - unpkg.com doesn't seem to have a `latest` specifier for alpha releases...
|
|
2402
2510
|
|
|
2403
2511
|
const LATEST = 'beta';
|
|
2404
|
-
const VERSION = true ? "3.0.
|
|
2512
|
+
const VERSION = true ? "3.0.14" : undefined;
|
|
2405
2513
|
const loadLibraryPromises = {}; // promises
|
|
2406
2514
|
|
|
2407
2515
|
/**
|
|
@@ -2689,7 +2797,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2689
2797
|
|
|
2690
2798
|
|
|
2691
2799
|
const NPM_TAG = 'latest';
|
|
2692
|
-
const VERSION = true ? "3.0.
|
|
2800
|
+
const VERSION = true ? "3.0.14" : undefined;
|
|
2693
2801
|
/**
|
|
2694
2802
|
* Gets worker object's name (for debugging in Chrome thread inspector window)
|
|
2695
2803
|
*/
|
|
@@ -2709,9 +2817,19 @@ function getWorkerName(worker) {
|
|
|
2709
2817
|
function getWorkerURL(worker, options = {}) {
|
|
2710
2818
|
const workerOptions = options[worker.id] || {};
|
|
2711
2819
|
const workerFile = `${worker.id}-worker.js`;
|
|
2712
|
-
let url = workerOptions.workerUrl; //
|
|
2820
|
+
let url = workerOptions.workerUrl; // HACK: Allow for non-nested workerUrl for the CompressionWorker.
|
|
2821
|
+
// For the compression worker, workerOptions is currently not nested correctly. For most loaders,
|
|
2822
|
+
// you'd have options within an object, i.e. `{mvt: {coordinates: ...}}` but the CompressionWorker
|
|
2823
|
+
// puts options at the top level, not within a `compression` key (its `id`). For this reason, the
|
|
2824
|
+
// above `workerOptions` will always be a string (i.e. `'gzip'`) for the CompressionWorker. To not
|
|
2825
|
+
// break backwards compatibility, we allow the CompressionWorker to have options at the top level.
|
|
2826
|
+
|
|
2827
|
+
if (!url && worker.id === 'compression') {
|
|
2828
|
+
url = options.workerUrl;
|
|
2829
|
+
} // If URL is test, generate local loaders.gl url
|
|
2713
2830
|
// @ts-ignore _workerType
|
|
2714
2831
|
|
|
2832
|
+
|
|
2715
2833
|
if (options._workerType === 'test') {
|
|
2716
2834
|
url = `modules/${worker.module}/dist/${workerFile}`;
|
|
2717
2835
|
} // If url override is not provided, generate a URL to published version on npm CDN unpkg.com
|
|
@@ -3763,7 +3881,8 @@ function isTransferable(object) {
|
|
|
3763
3881
|
|
|
3764
3882
|
if (typeof ImageBitmap !== 'undefined' && object instanceof ImageBitmap) {
|
|
3765
3883
|
return true;
|
|
3766
|
-
}
|
|
3884
|
+
} // @ts-ignore
|
|
3885
|
+
|
|
3767
3886
|
|
|
3768
3887
|
if (typeof OffscreenCanvas !== 'undefined' && object instanceof OffscreenCanvas) {
|
|
3769
3888
|
return true;
|
|
@@ -4903,9 +5022,9 @@ Object(_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__["createWorker"])(as
|
|
|
4903
5022
|
/***/ }),
|
|
4904
5023
|
|
|
4905
5024
|
/***/ 2:
|
|
4906
|
-
|
|
4907
|
-
!*** ../node/buffer
|
|
4908
|
-
|
|
5025
|
+
/*!********************************!*\
|
|
5026
|
+
!*** ../node/buffer (ignored) ***!
|
|
5027
|
+
\********************************/
|
|
4909
5028
|
/*! no static exports found */
|
|
4910
5029
|
/***/ (function(module, exports) {
|
|
4911
5030
|
|
|
@@ -4914,6 +5033,17 @@ Object(_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__["createWorker"])(as
|
|
|
4914
5033
|
/***/ }),
|
|
4915
5034
|
|
|
4916
5035
|
/***/ 3:
|
|
5036
|
+
/*!*********************************!*\
|
|
5037
|
+
!*** ./lib/node/util (ignored) ***!
|
|
5038
|
+
\*********************************/
|
|
5039
|
+
/*! no static exports found */
|
|
5040
|
+
/***/ (function(module, exports) {
|
|
5041
|
+
|
|
5042
|
+
/* (ignored) */
|
|
5043
|
+
|
|
5044
|
+
/***/ }),
|
|
5045
|
+
|
|
5046
|
+
/***/ 4:
|
|
4917
5047
|
/*!*******************************!*\
|
|
4918
5048
|
!*** ./lib/node/fs (ignored) ***!
|
|
4919
5049
|
\*******************************/
|
|
@@ -4922,6 +5052,17 @@ Object(_loaders_gl_worker_utils__WEBPACK_IMPORTED_MODULE_0__["createWorker"])(as
|
|
|
4922
5052
|
|
|
4923
5053
|
/* (ignored) */
|
|
4924
5054
|
|
|
5055
|
+
/***/ }),
|
|
5056
|
+
|
|
5057
|
+
/***/ 5:
|
|
5058
|
+
/*!****************************!*\
|
|
5059
|
+
!*** ../node/fs (ignored) ***!
|
|
5060
|
+
\****************************/
|
|
5061
|
+
/*! no static exports found */
|
|
5062
|
+
/***/ (function(module, exports) {
|
|
5063
|
+
|
|
5064
|
+
/* (ignored) */
|
|
5065
|
+
|
|
4925
5066
|
/***/ })
|
|
4926
5067
|
|
|
4927
5068
|
/******/ });
|