@loaders.gl/polyfills 3.4.13 → 3.4.15

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 (41) hide show
  1. package/dist/es5/bundle.js +1 -1
  2. package/dist/es5/bundle.js.map +1 -1
  3. package/dist/es5/index.js +11 -12
  4. package/dist/es5/index.js.map +1 -1
  5. package/dist/es5/lib/encoding.js +12 -13
  6. package/dist/es5/lib/encoding.js.map +1 -1
  7. package/dist/es5/node/buffer/to-array-buffer.node.js +1 -1
  8. package/dist/es5/node/buffer/to-array-buffer.node.js.map +1 -1
  9. package/dist/es5/node/fetch/fetch-file.node.js +34 -59
  10. package/dist/es5/node/fetch/fetch-file.node.js.map +1 -1
  11. package/dist/es5/node/fetch/fetch.node.js +75 -135
  12. package/dist/es5/node/fetch/fetch.node.js.map +1 -1
  13. package/dist/es5/node/fetch/headers.node.js +63 -104
  14. package/dist/es5/node/fetch/headers.node.js.map +1 -1
  15. package/dist/es5/node/fetch/response.node.js +40 -147
  16. package/dist/es5/node/fetch/response.node.js.map +1 -1
  17. package/dist/es5/node/fetch/utils/decode-data-uri.node.js +10 -16
  18. package/dist/es5/node/fetch/utils/decode-data-uri.node.js.map +1 -1
  19. package/dist/es5/node/fetch/utils/stream-utils.node.js +22 -62
  20. package/dist/es5/node/fetch/utils/stream-utils.node.js.map +1 -1
  21. package/dist/es5/node/file/blob-stream-controller.js +33 -71
  22. package/dist/es5/node/file/blob-stream-controller.js.map +1 -1
  23. package/dist/es5/node/file/blob-stream.js +12 -48
  24. package/dist/es5/node/file/blob-stream.js.map +1 -1
  25. package/dist/es5/node/file/blob.js +98 -182
  26. package/dist/es5/node/file/blob.js.map +1 -1
  27. package/dist/es5/node/file/file-reader.js +39 -124
  28. package/dist/es5/node/file/file-reader.js.map +1 -1
  29. package/dist/es5/node/file/file.js +14 -31
  30. package/dist/es5/node/file/file.js.map +1 -1
  31. package/dist/es5/node/file/readable-stream.js +1 -17
  32. package/dist/es5/node/file/readable-stream.js.map +1 -1
  33. package/dist/es5/node/images/encode-image.node.js +8 -10
  34. package/dist/es5/node/images/encode-image.node.js.map +1 -1
  35. package/dist/es5/node/images/parse-image.node.js +23 -49
  36. package/dist/es5/node/images/parse-image.node.js.map +1 -1
  37. package/dist/es5/promise/all-settled.js +7 -7
  38. package/dist/es5/promise/all-settled.js.map +1 -1
  39. package/dist/es5/utils/globals.js +3 -5
  40. package/dist/es5/utils/globals.js.map +1 -1
  41. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"file.js","names":["_blob","require","_Symbol$toStringTag","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","Symbol","toStringTag","FilePolyfill","_BlobPolyfill","_inherits2","_super","init","name","_this","options","length","undefined","_classCallCheck2","_defineProperty2","_assertThisInitialized2","String","replace","lastModified","Date","now","_createClass2","key","get","BlobPolyfill","exports"],"sources":["../../../../src/node/file/file.ts"],"sourcesContent":["// Forked from @gozala's web-file under MIT license https://github.com/Gozala/web-file\nimport {BlobPolyfill} from './blob';\n\n/**\n * Forked from @gozala's web-file under MIT license\n * @see https://github.com/Gozala/web-file\n */\n// @ts-ignore\nexport class FilePolyfill extends BlobPolyfill {\n // implements File {\n // public API\n /** The name of the file referenced by the File object. */\n name: string = '';\n /** The path the URL of the File is relative to. */\n webkitRelativePath: string = '';\n\n /**\n * Returns the last modified time of the file, in millisecond since the UNIX\n * epoch (January 1st, 1970 at Midnight).\n */\n lastModified: number;\n\n /**\n * @param init\n * @param name - A USVString representing the file name or the path\n * to the file.\n * @param [options]\n */\n constructor(init: BlobPart[], name: string, options: FilePropertyBag = {}) {\n super(init, options);\n // Per File API spec https://w3c.github.io/FileAPI/#file-constructor\n // Every \"/\" character of file name must be replaced with a \":\".\n /** @private */\n this.name = String(name).replace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AA,OAAMQ,IAAI,EAAEG,OAAO;IAAE,IAAAI,gBAAA,CAAA7B,OAAA,MAAA8B,uBAAA,CAAA9B,OAAA,EAAAwB,KAAA,WAjBR,EAAE;IAAA,IAAAK,gBAAA,CAAA7B,OAAA,MAAA8B,uBAAA,CAAA9B,OAAA,EAAAwB,KAAA,yBAEY,EAAE;IAAA,IAAAK,gBAAA,CAAA7B,OAAA,MAAA8B,uBAAA,CAAA9B,OAAA,EAAAwB,KAAA;IAmB7BA,KAAA,CAAKD,IAAI,GAAGQ,MAAM,CAACR,IAAI,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;IAE5CR,KAAA,CAAKS,YAAY,GAAG,CAAAR,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEQ,YAAY,KAAIC,IAAI,CAACC,GAAG,CAAC,CAAC;IAAC,OAAAX,KAAA;EAC1D;EAAC,IAAAY,aAAA,CAAApC,OAAA,EAAAkB,YAAA;IAAAmB,GAAA,EAAA7C,mBAAA;IAAA8C,GAAA,EAED,SAAAA,IAAA,EAA2B;MACzB,OAAO,MAAM;IACf;EAAC;EAAA,OAAApB,YAAA;AAAA,EAhC+BqB,kBAAY;AAAAC,OAAA,CAAAtB,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"file":"file.js","names":["_blob","require","_Symbol$toStringTag","Symbol","toStringTag","FilePolyfill","BlobPolyfill","constructor","init","name","options","arguments","length","undefined","_defineProperty2","default","String","replace","lastModified","Date","now","exports"],"sources":["../../../../src/node/file/file.ts"],"sourcesContent":["// Forked from @gozala's web-file under MIT license https://github.com/Gozala/web-file\nimport {BlobPolyfill} from './blob';\n\n/**\n * Forked from @gozala's web-file under MIT license\n * @see https://github.com/Gozala/web-file\n */\n// @ts-ignore\nexport class FilePolyfill extends BlobPolyfill {\n // implements File {\n // public API\n /** The name of the file referenced by the File object. */\n name: string = '';\n /** The path the URL of the File is relative to. */\n webkitRelativePath: string = '';\n\n /**\n * Returns the last modified time of the file, in millisecond since the UNIX\n * epoch (January 1st, 1970 at Midnight).\n */\n lastModified: number;\n\n /**\n * @param init\n * @param name - A USVString representing the file name or the path\n * to the file.\n * @param [options]\n */\n constructor(init: BlobPart[], name: string, options: FilePropertyBag = {}) {\n super(init, options);\n // Per File API spec https://w3c.github.io/FileAPI/#file-constructor\n // Every \"/\" character of file name must be replaced with a \":\".\n /** @private */\n this.name = String(name).replace(/\\//g, ':');\n /** @private */\n this.lastModified = options?.lastModified || Date.now();\n }\n\n get [Symbol.toStringTag]() {\n return 'File';\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAAoC,IAAAC,mBAAA;AAAAA,mBAAA,GAqC7BC,MAAM,CAACC,WAAW;AA9BlB,MAAMC,YAAY,SAASC,kBAAY,CAAC;EAoB7CC,WAAWA,CAACC,IAAgB,EAAEC,IAAY,EAAiC;IAAA,IAA/BC,OAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IACvE,KAAK,CAACH,IAAI,EAAEE,OAAO,CAAC;IAAC,IAAAI,gBAAA,CAAAC,OAAA,gBAjBR,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,8BAEY,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAmB7B,IAAI,CAACN,IAAI,GAAGO,MAAM,CAACP,IAAI,CAAC,CAACQ,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;IAE5C,IAAI,CAACC,YAAY,GAAG,CAAAR,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEQ,YAAY,KAAIC,IAAI,CAACC,GAAG,CAAC,CAAC;EACzD;EAEA,KAAAlB,mBAAA,IAA2B;IACzB,OAAO,MAAM;EACf;AACF;AAACmB,OAAA,CAAAhB,YAAA,GAAAA,YAAA"}
@@ -1,27 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.ReadableStreamPolyfill = void 0;
8
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
7
  var _webStreamsPolyfill = require("web-streams-polyfill");
14
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
15
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
16
8
  delete global.ReadableStream;
17
- var ReadableStreamPolyfill = function (_WSPReadableStream) {
18
- (0, _inherits2.default)(ReadableStreamPolyfill, _WSPReadableStream);
19
- var _super = _createSuper(ReadableStreamPolyfill);
20
- function ReadableStreamPolyfill() {
21
- (0, _classCallCheck2.default)(this, ReadableStreamPolyfill);
22
- return _super.apply(this, arguments);
23
- }
24
- return (0, _createClass2.default)(ReadableStreamPolyfill);
25
- }(_webStreamsPolyfill.ReadableStream);
9
+ class ReadableStreamPolyfill extends _webStreamsPolyfill.ReadableStream {}
26
10
  exports.ReadableStreamPolyfill = ReadableStreamPolyfill;
27
11
  //# sourceMappingURL=readable-stream.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readable-stream.js","names":["_webStreamsPolyfill","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","global","ReadableStream","ReadableStreamPolyfill","_WSPReadableStream","_inherits2","_super","_classCallCheck2","_createClass2","WSPReadableStream","exports"],"sources":["../../../../src/node/file/readable-stream.ts"],"sourcesContent":["import {ReadableStream as WSPReadableStream} from 'web-streams-polyfill';\n\n// Want a polyfill, but please don't install it\n// @ts-ignore\ndelete global.ReadableStream;\n\n// @ts-ignore\nexport class ReadableStreamPolyfill<T> extends WSPReadableStream<T> implements ReadableStream {}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAAyE,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAP,KAAA,EAAAQ,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAS,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAR,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAQ,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;AAIzE,OAAOC,MAAM,CAACC,cAAc;AAAC,IAGhBC,sBAAsB,aAAAC,kBAAA;EAAA,IAAAC,UAAA,CAAApB,OAAA,EAAAkB,sBAAA,EAAAC,kBAAA;EAAA,IAAAE,MAAA,GAAA5B,YAAA,CAAAyB,sBAAA;EAAA,SAAAA,uBAAA;IAAA,IAAAI,gBAAA,CAAAtB,OAAA,QAAAkB,sBAAA;IAAA,OAAAG,MAAA,CAAAd,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAiB,aAAA,CAAAvB,OAAA,EAAAkB,sBAAA;AAAA,EAAYM,kCAAiB;AAAAC,OAAA,CAAAP,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"file":"readable-stream.js","names":["_webStreamsPolyfill","require","global","ReadableStream","ReadableStreamPolyfill","WSPReadableStream","exports"],"sources":["../../../../src/node/file/readable-stream.ts"],"sourcesContent":["import {ReadableStream as WSPReadableStream} from 'web-streams-polyfill';\n\n// Want a polyfill, but please don't install it\n// @ts-ignore\ndelete global.ReadableStream;\n\n// @ts-ignore\nexport class ReadableStreamPolyfill<T> extends WSPReadableStream<T> implements ReadableStream {}\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAIA,OAAOC,MAAM,CAACC,cAAc;AAGrB,MAAMC,sBAAsB,SAAYC,kCAAiB,CAA8B;AAAEC,OAAA,CAAAF,sBAAA,GAAAA,sBAAA"}
@@ -10,19 +10,17 @@ var _savePixels = _interopRequireDefault(require("save-pixels"));
10
10
  var _ndarray = _interopRequireDefault(require("ndarray"));
11
11
  var _toArrayBuffer = require("../buffer/to-array-buffer.node");
12
12
  function encodeImageToStreamNode(image, options) {
13
- var type = options.type ? options.type.replace('image/', '') : 'jpeg';
14
- var pixels = (0, _ndarray.default)(image.data, [image.width, image.height, 4], [4, image.width * 4, 1], 0);
13
+ const type = options.type ? options.type.replace('image/', '') : 'jpeg';
14
+ const pixels = (0, _ndarray.default)(image.data, [image.width, image.height, 4], [4, image.width * 4, 1], 0);
15
15
  return (0, _savePixels.default)(pixels, type, options);
16
16
  }
17
17
  function encodeImageNode(image, options) {
18
- var imageStream = encodeImageToStreamNode(image, options);
19
- return new Promise(function (resolve) {
20
- var buffers = [];
21
- imageStream.on('data', function (buffer) {
22
- return buffers.push(buffer);
23
- });
24
- imageStream.on('end', function () {
25
- var buffer = Buffer.concat(buffers);
18
+ const imageStream = encodeImageToStreamNode(image, options);
19
+ return new Promise(resolve => {
20
+ const buffers = [];
21
+ imageStream.on('data', buffer => buffers.push(buffer));
22
+ imageStream.on('end', () => {
23
+ const buffer = Buffer.concat(buffers);
26
24
  resolve((0, _toArrayBuffer.bufferToArrayBuffer)(buffer));
27
25
  });
28
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"encode-image.node.js","names":["_savePixels","_interopRequireDefault","require","_ndarray","_toArrayBuffer","encodeImageToStreamNode","image","options","type","replace","pixels","ndarray","data","width","height","savePixels","encodeImageNode","imageStream","Promise","resolve","buffers","on","buffer","push","Buffer","concat","bufferToArrayBuffer"],"sources":["../../../../src/node/images/encode-image.node.ts"],"sourcesContent":["// Use stackgl modules for DOM-less reading and writing of images\n\nimport savePixels from 'save-pixels';\nimport ndarray from 'ndarray';\nimport {bufferToArrayBuffer} from '../buffer/to-array-buffer.node';\n\n/**\n * Returns data bytes representing a compressed image in PNG or JPG format,\n * This data can be saved using file system (f) methods or\n * used in a request.\n * @param image to save\n * @param options\n * @param options.type='png' - png, jpg or image/png, image/jpg are valid\n * @param options.dataURI - Whether to include a data URI header\n * @return {*} bytes\n */\nexport function encodeImageToStreamNode(\n image: {data: any; width: number; height: number},\n options: {type?: string; dataURI?: string}\n) {\n // Support MIME type strings\n const type = options.type ? options.type.replace('image/', '') : 'jpeg';\n const pixels = ndarray(image.data, [image.width, image.height, 4], [4, image.width * 4, 1], 0);\n\n // Note: savePixels returns a stream\n return savePixels(pixels, type, options);\n}\n\nexport function encodeImageNode(image, options) {\n const imageStream = encodeImageToStreamNode(image, options);\n\n return new Promise((resolve) => {\n const buffers: any[] = [];\n imageStream.on('data', (buffer) => buffers.push(buffer));\n // TODO - convert to arraybuffer?\n imageStream.on('end', () => {\n const buffer = Buffer.concat(buffers);\n resolve(bufferToArrayBuffer(buffer));\n });\n });\n}\n"],"mappings":";;;;;;;;AAEA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAYO,SAASG,uBAAuBA,CACrCC,KAAiD,EACjDC,OAA0C,EAC1C;EAEA,IAAMC,IAAI,GAAGD,OAAO,CAACC,IAAI,GAAGD,OAAO,CAACC,IAAI,CAACC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,MAAM;EACvE,IAAMC,MAAM,GAAG,IAAAC,gBAAO,EAACL,KAAK,CAACM,IAAI,EAAE,CAACN,KAAK,CAACO,KAAK,EAAEP,KAAK,CAACQ,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAER,KAAK,CAACO,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EAG9F,OAAO,IAAAE,mBAAU,EAACL,MAAM,EAAEF,IAAI,EAAED,OAAO,CAAC;AAC1C;AAEO,SAASS,eAAeA,CAACV,KAAK,EAAEC,OAAO,EAAE;EAC9C,IAAMU,WAAW,GAAGZ,uBAAuB,CAACC,KAAK,EAAEC,OAAO,CAAC;EAE3D,OAAO,IAAIW,OAAO,CAAC,UAACC,OAAO,EAAK;IAC9B,IAAMC,OAAc,GAAG,EAAE;IACzBH,WAAW,CAACI,EAAE,CAAC,MAAM,EAAE,UAACC,MAAM;MAAA,OAAKF,OAAO,CAACG,IAAI,CAACD,MAAM,CAAC;IAAA,EAAC;IAExDL,WAAW,CAACI,EAAE,CAAC,KAAK,EAAE,YAAM;MAC1B,IAAMC,MAAM,GAAGE,MAAM,CAACC,MAAM,CAACL,OAAO,CAAC;MACrCD,OAAO,CAAC,IAAAO,kCAAmB,EAACJ,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ"}
1
+ {"version":3,"file":"encode-image.node.js","names":["_savePixels","_interopRequireDefault","require","_ndarray","_toArrayBuffer","encodeImageToStreamNode","image","options","type","replace","pixels","ndarray","data","width","height","savePixels","encodeImageNode","imageStream","Promise","resolve","buffers","on","buffer","push","Buffer","concat","bufferToArrayBuffer"],"sources":["../../../../src/node/images/encode-image.node.ts"],"sourcesContent":["// Use stackgl modules for DOM-less reading and writing of images\n\nimport savePixels from 'save-pixels';\nimport ndarray from 'ndarray';\nimport {bufferToArrayBuffer} from '../buffer/to-array-buffer.node';\n\n/**\n * Returns data bytes representing a compressed image in PNG or JPG format,\n * This data can be saved using file system (f) methods or\n * used in a request.\n * @param image to save\n * @param options\n * @param options.type='png' - png, jpg or image/png, image/jpg are valid\n * @param options.dataURI - Whether to include a data URI header\n * @return {*} bytes\n */\nexport function encodeImageToStreamNode(\n image: {data: any; width: number; height: number},\n options: {type?: string; dataURI?: string}\n) {\n // Support MIME type strings\n const type = options.type ? options.type.replace('image/', '') : 'jpeg';\n const pixels = ndarray(image.data, [image.width, image.height, 4], [4, image.width * 4, 1], 0);\n\n // Note: savePixels returns a stream\n return savePixels(pixels, type, options);\n}\n\nexport function encodeImageNode(image, options) {\n const imageStream = encodeImageToStreamNode(image, options);\n\n return new Promise((resolve) => {\n const buffers: any[] = [];\n imageStream.on('data', (buffer) => buffers.push(buffer));\n // TODO - convert to arraybuffer?\n imageStream.on('end', () => {\n const buffer = Buffer.concat(buffers);\n resolve(bufferToArrayBuffer(buffer));\n });\n });\n}\n"],"mappings":";;;;;;;;AAEA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAYO,SAASG,uBAAuBA,CACrCC,KAAiD,EACjDC,OAA0C,EAC1C;EAEA,MAAMC,IAAI,GAAGD,OAAO,CAACC,IAAI,GAAGD,OAAO,CAACC,IAAI,CAACC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,MAAM;EACvE,MAAMC,MAAM,GAAG,IAAAC,gBAAO,EAACL,KAAK,CAACM,IAAI,EAAE,CAACN,KAAK,CAACO,KAAK,EAAEP,KAAK,CAACQ,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAER,KAAK,CAACO,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EAG9F,OAAO,IAAAE,mBAAU,EAACL,MAAM,EAAEF,IAAI,EAAED,OAAO,CAAC;AAC1C;AAEO,SAASS,eAAeA,CAACV,KAAK,EAAEC,OAAO,EAAE;EAC9C,MAAMU,WAAW,GAAGZ,uBAAuB,CAACC,KAAK,EAAEC,OAAO,CAAC;EAE3D,OAAO,IAAIW,OAAO,CAAEC,OAAO,IAAK;IAC9B,MAAMC,OAAc,GAAG,EAAE;IACzBH,WAAW,CAACI,EAAE,CAAC,MAAM,EAAGC,MAAM,IAAKF,OAAO,CAACG,IAAI,CAACD,MAAM,CAAC,CAAC;IAExDL,WAAW,CAACI,EAAE,CAAC,KAAK,EAAE,MAAM;MAC1B,MAAMC,MAAM,GAAGE,MAAM,CAACC,MAAM,CAACL,OAAO,CAAC;MACrCD,OAAO,CAAC,IAAAO,kCAAmB,EAACJ,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ"}
@@ -6,59 +6,33 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.NODE_FORMAT_SUPPORT = void 0;
8
8
  exports.parseImageNode = parseImageNode;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
9
  var _getPixels = _interopRequireDefault(require("get-pixels"));
13
- var NODE_FORMAT_SUPPORT = ['image/png', 'image/jpeg', 'image/gif'];
10
+ const NODE_FORMAT_SUPPORT = ['image/png', 'image/jpeg', 'image/gif'];
14
11
  exports.NODE_FORMAT_SUPPORT = NODE_FORMAT_SUPPORT;
15
- function parseImageNode(_x, _x2) {
16
- return _parseImageNode.apply(this, arguments);
17
- }
18
- function _parseImageNode() {
19
- _parseImageNode = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(arrayBuffer, mimeType) {
20
- var buffer, ndarray;
21
- return _regenerator.default.wrap(function _callee$(_context) {
22
- while (1) switch (_context.prev = _context.next) {
23
- case 0:
24
- if (mimeType) {
25
- _context.next = 2;
26
- break;
27
- }
28
- throw new Error('MIMEType is required to parse image under Node.js');
29
- case 2:
30
- buffer = arrayBuffer instanceof Buffer ? arrayBuffer : Buffer.from(arrayBuffer);
31
- _context.next = 5;
32
- return getPixelsAsync(buffer, mimeType);
33
- case 5:
34
- ndarray = _context.sent;
35
- return _context.abrupt("return", ndarray);
36
- case 7:
37
- case "end":
38
- return _context.stop();
39
- }
40
- }, _callee);
41
- }));
42
- return _parseImageNode.apply(this, arguments);
12
+ async function parseImageNode(arrayBuffer, mimeType) {
13
+ if (!mimeType) {
14
+ throw new Error('MIMEType is required to parse image under Node.js');
15
+ }
16
+ const buffer = arrayBuffer instanceof Buffer ? arrayBuffer : Buffer.from(arrayBuffer);
17
+ const ndarray = await getPixelsAsync(buffer, mimeType);
18
+ return ndarray;
43
19
  }
44
20
  function getPixelsAsync(buffer, mimeType) {
45
- return new Promise(function (resolve) {
46
- return (0, _getPixels.default)(buffer, mimeType, function (err, ndarray) {
47
- if (err) {
48
- throw err;
49
- }
50
- var shape = (0, _toConsumableArray2.default)(ndarray.shape);
51
- var layers = ndarray.shape.length === 4 ? ndarray.shape.shift() : 1;
52
- var data = ndarray.data instanceof Buffer ? new Uint8Array(ndarray.data) : ndarray.data;
53
- resolve({
54
- shape: shape,
55
- data: data,
56
- width: ndarray.shape[0],
57
- height: ndarray.shape[1],
58
- components: ndarray.shape[2],
59
- layers: layers ? [layers] : []
60
- });
21
+ return new Promise(resolve => (0, _getPixels.default)(buffer, mimeType, (err, ndarray) => {
22
+ if (err) {
23
+ throw err;
24
+ }
25
+ const shape = [...ndarray.shape];
26
+ const layers = ndarray.shape.length === 4 ? ndarray.shape.shift() : 1;
27
+ const data = ndarray.data instanceof Buffer ? new Uint8Array(ndarray.data) : ndarray.data;
28
+ resolve({
29
+ shape,
30
+ data,
31
+ width: ndarray.shape[0],
32
+ height: ndarray.shape[1],
33
+ components: ndarray.shape[2],
34
+ layers: layers ? [layers] : []
61
35
  });
62
- });
36
+ }));
63
37
  }
64
38
  //# sourceMappingURL=parse-image.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-image.node.js","names":["_getPixels","_interopRequireDefault","require","NODE_FORMAT_SUPPORT","exports","parseImageNode","_x","_x2","_parseImageNode","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","arrayBuffer","mimeType","buffer","ndarray","wrap","_callee$","_context","prev","next","Error","Buffer","from","getPixelsAsync","sent","abrupt","stop","Promise","resolve","getPixels","err","shape","_toConsumableArray2","layers","length","shift","data","Uint8Array","width","height","components"],"sources":["../../../../src/node/images/parse-image.node.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport getPixels from 'get-pixels';\n\n/** Declares which image format mime types this loader polyfill supports */\nexport const NODE_FORMAT_SUPPORT = ['image/png', 'image/jpeg', 'image/gif'];\n\n// Note: These types are also defined in @loaders.gl/images and need to be kept in sync\ntype NDArray = {\n shape: number[];\n data: Uint8Array;\n width: number;\n height: number;\n components: number;\n layers: number[];\n};\n\nexport async function parseImageNode(arrayBuffer: ArrayBuffer, mimeType: string): Promise<NDArray> {\n if (!mimeType) {\n throw new Error('MIMEType is required to parse image under Node.js');\n }\n\n const buffer = arrayBuffer instanceof Buffer ? arrayBuffer : Buffer.from(arrayBuffer);\n const ndarray = await getPixelsAsync(buffer, mimeType);\n return ndarray;\n}\n\n// TODO - check if getPixels callback is asynchronous if provided with buffer input\n// if not, parseImage can be a sync function\nfunction getPixelsAsync(buffer: Buffer, mimeType: string): Promise<NDArray> {\n return new Promise<NDArray>((resolve) =>\n getPixels(buffer, mimeType, (err, ndarray) => {\n if (err) {\n throw err;\n }\n\n const shape = [...ndarray.shape];\n const layers = ndarray.shape.length === 4 ? ndarray.shape.shift() : 1;\n const data = ndarray.data instanceof Buffer ? new Uint8Array(ndarray.data) : ndarray.data;\n\n // extract width/height etc\n resolve({\n shape,\n data,\n width: ndarray.shape[0],\n height: ndarray.shape[1],\n components: ndarray.shape[2],\n // TODO - error\n layers: layers ? [layers] : []\n });\n })\n );\n}\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGO,IAAMC,mBAAmB,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;AAACC,OAAA,CAAAD,mBAAA,GAAAA,mBAAA;AAAA,SAYtDE,cAAcA,CAAAC,EAAA,EAAAC,GAAA;EAAA,OAAAC,eAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,gBAAA;EAAAA,eAAA,OAAAG,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAA7B,SAAAC,QAA8BC,WAAwB,EAAEC,QAAgB;IAAA,IAAAC,MAAA,EAAAC,OAAA;IAAA,OAAAN,YAAA,CAAAD,OAAA,CAAAQ,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAA,IACxEP,QAAQ;YAAAK,QAAA,CAAAE,IAAA;YAAA;UAAA;UAAA,MACL,IAAIC,KAAK,CAAC,mDAAmD,CAAC;QAAA;UAGhEP,MAAM,GAAGF,WAAW,YAAYU,MAAM,GAAGV,WAAW,GAAGU,MAAM,CAACC,IAAI,CAACX,WAAW,CAAC;UAAAM,QAAA,CAAAE,IAAA;UAAA,OAC/DI,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":3,"file":"parse-image.node.js","names":["_getPixels","_interopRequireDefault","require","NODE_FORMAT_SUPPORT","exports","parseImageNode","arrayBuffer","mimeType","Error","buffer","Buffer","from","ndarray","getPixelsAsync","Promise","resolve","getPixels","err","shape","layers","length","shift","data","Uint8Array","width","height","components"],"sources":["../../../../src/node/images/parse-image.node.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport getPixels from 'get-pixels';\n\n/** Declares which image format mime types this loader polyfill supports */\nexport const NODE_FORMAT_SUPPORT = ['image/png', 'image/jpeg', 'image/gif'];\n\n// Note: These types are also defined in @loaders.gl/images and need to be kept in sync\ntype NDArray = {\n shape: number[];\n data: Uint8Array;\n width: number;\n height: number;\n components: number;\n layers: number[];\n};\n\nexport async function parseImageNode(arrayBuffer: ArrayBuffer, mimeType: string): Promise<NDArray> {\n if (!mimeType) {\n throw new Error('MIMEType is required to parse image under Node.js');\n }\n\n const buffer = arrayBuffer instanceof Buffer ? arrayBuffer : Buffer.from(arrayBuffer);\n const ndarray = await getPixelsAsync(buffer, mimeType);\n return ndarray;\n}\n\n// TODO - check if getPixels callback is asynchronous if provided with buffer input\n// if not, parseImage can be a sync function\nfunction getPixelsAsync(buffer: Buffer, mimeType: string): Promise<NDArray> {\n return new Promise<NDArray>((resolve) =>\n getPixels(buffer, mimeType, (err, ndarray) => {\n if (err) {\n throw err;\n }\n\n const shape = [...ndarray.shape];\n const layers = ndarray.shape.length === 4 ? ndarray.shape.shift() : 1;\n const data = ndarray.data instanceof Buffer ? new Uint8Array(ndarray.data) : ndarray.data;\n\n // extract width/height etc\n resolve({\n shape,\n data,\n width: ndarray.shape[0],\n height: ndarray.shape[1],\n components: ndarray.shape[2],\n // TODO - error\n layers: layers ? [layers] : []\n });\n })\n );\n}\n"],"mappings":";;;;;;;;AAEA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGO,MAAMC,mBAAmB,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;AAACC,OAAA,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AAC;AACH"}
@@ -5,21 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.REJECTED_STATUS = exports.FULFILLED_STATUS = void 0;
7
7
  exports.allSettled = allSettled;
8
- var REJECTED_STATUS = 'rejected';
8
+ const REJECTED_STATUS = 'rejected';
9
9
  exports.REJECTED_STATUS = REJECTED_STATUS;
10
- var FULFILLED_STATUS = 'fulfilled';
10
+ const FULFILLED_STATUS = 'fulfilled';
11
11
  exports.FULFILLED_STATUS = FULFILLED_STATUS;
12
12
  function allSettled(promises) {
13
- var mappedPromises = promises.map(function (promise) {
14
- return promise.then(function (value) {
13
+ const mappedPromises = promises.map(promise => {
14
+ return promise.then(value => {
15
15
  return {
16
16
  status: FULFILLED_STATUS,
17
- value: value
17
+ value
18
18
  };
19
- }).catch(function (reason) {
19
+ }).catch(reason => {
20
20
  return {
21
21
  status: REJECTED_STATUS,
22
- reason: reason
22
+ reason
23
23
  };
24
24
  });
25
25
  });
@@ -1 +1 @@
1
- {"version":3,"file":"all-settled.js","names":["REJECTED_STATUS","exports","FULFILLED_STATUS","allSettled","promises","mappedPromises","map","promise","then","value","status","catch","reason","Promise","all"],"sources":["../../../src/promise/all-settled.ts"],"sourcesContent":["export const REJECTED_STATUS = 'rejected';\nexport const FULFILLED_STATUS = 'fulfilled';\n\n/**\n * Handle list of promises and return all values regardless of results.\n * Polyfill for Promise.allSettled() method.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled\n * @param promises\n */\nexport function allSettled(promises: Promise<any>[]): Promise<any> {\n const mappedPromises = promises.map((promise) => {\n return promise\n .then((value) => {\n return {status: FULFILLED_STATUS, value};\n })\n .catch((reason) => {\n return {status: REJECTED_STATUS, reason};\n });\n });\n return Promise.all(mappedPromises);\n}\n"],"mappings":";;;;;;;AAAO,IAAMA,eAAe,GAAG,UAAU;AAACC,OAAA,CAAAD,eAAA,GAAAA,eAAA;AACnC,IAAME,gBAAgB,GAAG,WAAW;AAACD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAQrC,SAASC,UAAUA,CAACC,QAAwB,EAAgB;EACjE,IAAMC,cAAc,GAAGD,QAAQ,CAACE,GAAG,CAAC,UAACC,OAAO,EAAK;IAC/C,OAAOA,OAAO,CACXC,IAAI,CAAC,UAACC,KAAK,EAAK;MACf,OAAO;QAACC,MAAM,EAAER,gBAAgB;QAAEO,KAAK,EAALA;MAAK,CAAC;IAC1C,CAAC,CAAC,CACDE,KAAK,CAAC,UAACC,MAAM,EAAK;MACjB,OAAO;QAACF,MAAM,EAAEV,eAAe;QAAEY,MAAM,EAANA;MAAM,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC,CAAC;EACF,OAAOC,OAAO,CAACC,GAAG,CAACT,cAAc,CAAC;AACpC"}
1
+ {"version":3,"file":"all-settled.js","names":["REJECTED_STATUS","exports","FULFILLED_STATUS","allSettled","promises","mappedPromises","map","promise","then","value","status","catch","reason","Promise","all"],"sources":["../../../src/promise/all-settled.ts"],"sourcesContent":["export const REJECTED_STATUS = 'rejected';\nexport const FULFILLED_STATUS = 'fulfilled';\n\n/**\n * Handle list of promises and return all values regardless of results.\n * Polyfill for Promise.allSettled() method.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled\n * @param promises\n */\nexport function allSettled(promises: Promise<any>[]): Promise<any> {\n const mappedPromises = promises.map((promise) => {\n return promise\n .then((value) => {\n return {status: FULFILLED_STATUS, value};\n })\n .catch((reason) => {\n return {status: REJECTED_STATUS, reason};\n });\n });\n return Promise.all(mappedPromises);\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,eAAe,GAAG,UAAU;AAACC,OAAA,CAAAD,eAAA,GAAAA,eAAA;AACnC,MAAME,gBAAgB,GAAG,WAAW;AAACD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAQrC,SAASC,UAAUA,CAACC,QAAwB,EAAgB;EACjE,MAAMC,cAAc,GAAGD,QAAQ,CAACE,GAAG,CAAEC,OAAO,IAAK;IAC/C,OAAOA,OAAO,CACXC,IAAI,CAAEC,KAAK,IAAK;MACf,OAAO;QAACC,MAAM,EAAER,gBAAgB;QAAEO;MAAK,CAAC;IAC1C,CAAC,CAAC,CACDE,KAAK,CAAEC,MAAM,IAAK;MACjB,OAAO;QAACF,MAAM,EAAEV,eAAe;QAAEY;MAAM,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC,CAAC;EACF,OAAOC,OAAO,CAACC,GAAG,CAACT,cAAc,CAAC;AACpC"}
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.isBrowser = exports.global = void 0;
8
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
- var isBrowser = (typeof process === "undefined" ? "undefined" : (0, _typeof2.default)(process)) !== 'object' || String(process) !== '[object process]' || process.browser;
7
+ const isBrowser = typeof process !== 'object' || String(process) !== '[object process]' || process.browser;
10
8
  exports.isBrowser = isBrowser;
11
- var globals = {
9
+ const globals = {
12
10
  self: typeof self !== 'undefined' && self,
13
11
  window: typeof window !== 'undefined' && window,
14
12
  global: typeof global !== 'undefined' && global
15
13
  };
16
- var global_ = globals.global || globals.self || globals.window;
14
+ const global_ = globals.global || globals.self || globals.window;
17
15
  exports.global = global_;
18
16
  //# sourceMappingURL=globals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"globals.js","names":["isBrowser","process","_typeof2","default","String","browser","exports","globals","self","window","global","global_"],"sources":["../../../src/utils/globals.ts"],"sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n// Purpose: include this in your module to avoids adding dependencies on\n// micro modules like 'global' and 'is-browser';\n\n/* eslint-disable no-restricted-globals */\nconst isBrowser: boolean =\n // @ts-ignore process.browser\n typeof process !== 'object' || String(process) !== '[object process]' || process.browser;\n\nconst globals = {\n self: typeof self !== 'undefined' && self,\n window: typeof window !== 'undefined' && window,\n global: typeof global !== 'undefined' && global\n};\n\nconst global_: object = (globals.global || globals.self || globals.window) as object;\n\nexport {isBrowser, global_ as global};\n"],"mappings":";;;;;;;;AAwBA,IAAMA,SAAkB,GAEtB,QAAOC,OAAO,qCAAAC,QAAA,CAAAC,OAAA,EAAPF,OAAO,OAAK,QAAQ,IAAIG,MAAM,CAACH,OAAO,CAAC,KAAK,kBAAkB,IAAIA,OAAO,CAACI,OAAO;AAACC,OAAA,CAAAN,SAAA,GAAAA,SAAA;AAE3F,IAAMO,OAAO,GAAG;EACdC,IAAI,EAAE,OAAOA,IAAI,KAAK,WAAW,IAAIA,IAAI;EACzCC,MAAM,EAAE,OAAOA,MAAM,KAAK,WAAW,IAAIA,MAAM;EAC/CC,MAAM,EAAE,OAAOA,MAAM,KAAK,WAAW,IAAIA;AAC3C,CAAC;AAED,IAAMC,OAAe,GAAIJ,OAAO,CAACG,MAAM,IAAIH,OAAO,CAACC,IAAI,IAAID,OAAO,CAACE,MAAiB;AAACH,OAAA,CAAAI,MAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"globals.js","names":["isBrowser","process","String","browser","exports","globals","self","window","global","global_"],"sources":["../../../src/utils/globals.ts"],"sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n// Purpose: include this in your module to avoids adding dependencies on\n// micro modules like 'global' and 'is-browser';\n\n/* eslint-disable no-restricted-globals */\nconst isBrowser: boolean =\n // @ts-ignore process.browser\n typeof process !== 'object' || String(process) !== '[object process]' || process.browser;\n\nconst globals = {\n self: typeof self !== 'undefined' && self,\n window: typeof window !== 'undefined' && window,\n global: typeof global !== 'undefined' && global\n};\n\nconst global_: object = (globals.global || globals.self || globals.window) as object;\n\nexport {isBrowser, global_ as global};\n"],"mappings":";;;;;;AAwBA,MAAMA,SAAkB,GAEtB,OAAOC,OAAO,KAAK,QAAQ,IAAIC,MAAM,CAACD,OAAO,CAAC,KAAK,kBAAkB,IAAIA,OAAO,CAACE,OAAO;AAACC,OAAA,CAAAJ,SAAA,GAAAA,SAAA;AAE3F,MAAMK,OAAO,GAAG;EACdC,IAAI,EAAE,OAAOA,IAAI,KAAK,WAAW,IAAIA,IAAI;EACzCC,MAAM,EAAE,OAAOA,MAAM,KAAK,WAAW,IAAIA,MAAM;EAC/CC,MAAM,EAAE,OAAOA,MAAM,KAAK,WAAW,IAAIA;AAC3C,CAAC;AAED,MAAMC,OAAe,GAAIJ,OAAO,CAACG,MAAM,IAAIH,OAAO,CAACC,IAAI,IAAID,OAAO,CAACE,MAAiB;AAACH,OAAA,CAAAI,MAAA,GAAAC,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/polyfills",
3
- "version": "3.4.13",
3
+ "version": "3.4.15",
4
4
  "description": "Polyfills for TextEncoder/TextDecoder",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -106,5 +106,5 @@
106
106
  "through": "^2.3.8",
107
107
  "web-streams-polyfill": "^3.0.0"
108
108
  },
109
- "gitHead": "be8849c02972ce541e01720d29b976f830d6af92"
109
+ "gitHead": "19e941d5805568e449ef9092490d6568a4853298"
110
110
  }