@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.
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/index.js +11 -12
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/encoding.js +12 -13
- package/dist/es5/lib/encoding.js.map +1 -1
- package/dist/es5/node/buffer/to-array-buffer.node.js +1 -1
- package/dist/es5/node/buffer/to-array-buffer.node.js.map +1 -1
- package/dist/es5/node/fetch/fetch-file.node.js +34 -59
- package/dist/es5/node/fetch/fetch-file.node.js.map +1 -1
- package/dist/es5/node/fetch/fetch.node.js +75 -135
- package/dist/es5/node/fetch/fetch.node.js.map +1 -1
- package/dist/es5/node/fetch/headers.node.js +63 -104
- package/dist/es5/node/fetch/headers.node.js.map +1 -1
- package/dist/es5/node/fetch/response.node.js +40 -147
- package/dist/es5/node/fetch/response.node.js.map +1 -1
- package/dist/es5/node/fetch/utils/decode-data-uri.node.js +10 -16
- package/dist/es5/node/fetch/utils/decode-data-uri.node.js.map +1 -1
- package/dist/es5/node/fetch/utils/stream-utils.node.js +22 -62
- package/dist/es5/node/fetch/utils/stream-utils.node.js.map +1 -1
- package/dist/es5/node/file/blob-stream-controller.js +33 -71
- package/dist/es5/node/file/blob-stream-controller.js.map +1 -1
- package/dist/es5/node/file/blob-stream.js +12 -48
- package/dist/es5/node/file/blob-stream.js.map +1 -1
- package/dist/es5/node/file/blob.js +98 -182
- package/dist/es5/node/file/blob.js.map +1 -1
- package/dist/es5/node/file/file-reader.js +39 -124
- package/dist/es5/node/file/file-reader.js.map +1 -1
- package/dist/es5/node/file/file.js +14 -31
- package/dist/es5/node/file/file.js.map +1 -1
- package/dist/es5/node/file/readable-stream.js +1 -17
- package/dist/es5/node/file/readable-stream.js.map +1 -1
- package/dist/es5/node/images/encode-image.node.js +8 -10
- package/dist/es5/node/images/encode-image.node.js.map +1 -1
- package/dist/es5/node/images/parse-image.node.js +23 -49
- package/dist/es5/node/images/parse-image.node.js.map +1 -1
- package/dist/es5/promise/all-settled.js +7 -7
- package/dist/es5/promise/all-settled.js.map +1 -1
- package/dist/es5/utils/globals.js +3 -5
- package/dist/es5/utils/globals.js.map +1 -1
- package/package.json +2 -2
package/dist/es5/bundle.js
CHANGED
package/dist/es5/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";;AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
package/dist/es5/index.js
CHANGED
|
@@ -1,48 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
Object.defineProperty(exports, "BlobPolyfill", {
|
|
8
7
|
enumerable: true,
|
|
9
|
-
get: function
|
|
8
|
+
get: function () {
|
|
10
9
|
return _blob.BlobPolyfill;
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
12
|
Object.defineProperty(exports, "FilePolyfill", {
|
|
14
13
|
enumerable: true,
|
|
15
|
-
get: function
|
|
14
|
+
get: function () {
|
|
16
15
|
return _file.FilePolyfill;
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
18
|
Object.defineProperty(exports, "FileReaderPolyfill", {
|
|
20
19
|
enumerable: true,
|
|
21
|
-
get: function
|
|
20
|
+
get: function () {
|
|
22
21
|
return _fileReader.FileReaderPolyfill;
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
24
|
Object.defineProperty(exports, "ReadableStreamPolyfill", {
|
|
26
25
|
enumerable: true,
|
|
27
|
-
get: function
|
|
26
|
+
get: function () {
|
|
28
27
|
return _readableStream.ReadableStreamPolyfill;
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
30
|
Object.defineProperty(exports, "_fetchFileNode", {
|
|
32
31
|
enumerable: true,
|
|
33
|
-
get: function
|
|
32
|
+
get: function () {
|
|
34
33
|
return _fetchFile.fetchFileNode;
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
Object.defineProperty(exports, "_fetchNode", {
|
|
38
37
|
enumerable: true,
|
|
39
|
-
get: function
|
|
38
|
+
get: function () {
|
|
40
39
|
return _fetch.fetchNode;
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
42
|
Object.defineProperty(exports, "installFilePolyfills", {
|
|
44
43
|
enumerable: true,
|
|
45
|
-
get: function
|
|
44
|
+
get: function () {
|
|
46
45
|
return _installFilePolyfills.installFilePolyfills;
|
|
47
46
|
}
|
|
48
47
|
});
|
|
@@ -62,13 +61,13 @@ var _fileReader = require("./node/file/file-reader");
|
|
|
62
61
|
var _file = require("./node/file/file");
|
|
63
62
|
var _installFilePolyfills = require("./node/file/install-file-polyfills");
|
|
64
63
|
var _fetchFile = require("./node/fetch/fetch-file.node");
|
|
65
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
66
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
67
|
-
|
|
64
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
65
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
66
|
+
const installTextEncoder = !_globals.isBrowser || !('TextEncoder' in _globals.global);
|
|
68
67
|
if (installTextEncoder) {
|
|
69
68
|
_globals.global['TextEncoder'] = _encoding.TextEncoder;
|
|
70
69
|
}
|
|
71
|
-
|
|
70
|
+
const installTextDecoder = !_globals.isBrowser || !('TextDecoder' in _globals.global);
|
|
72
71
|
if (installTextDecoder) {
|
|
73
72
|
_globals.global['TextDecoder'] = _encoding.TextDecoder;
|
|
74
73
|
}
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_xmldom","require","_globals","_encoding","_allSettled","base64","_interopRequireWildcard","_headers","_response","_fetch","_encodeImage","_parseImage","_readableStream","_blob","_fileReader","_file","_installFilePolyfills","_fetchFile","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_xmldom","require","_globals","_encoding","_allSettled","base64","_interopRequireWildcard","_headers","_response","_fetch","_encodeImage","_parseImage","_readableStream","_blob","_fileReader","_file","_installFilePolyfills","_fetchFile","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","installTextEncoder","isBrowser","global","TextEncoder","installTextDecoder","TextDecoder","atob","btoa","HeadersNode","ResponseNode","fetchNode","DOMParser","encodeImageNode","parseImageNode","NODE_FORMAT_SUPPORT","Promise","allSettled"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable dot-notation */\nimport {DOMParser} from '@xmldom/xmldom';\nimport {isBrowser, global} from './utils/globals';\n\nimport {TextDecoder, TextEncoder} from './lib/encoding';\nimport {allSettled} from './promise/all-settled';\n\n// Node specific\nimport * as base64 from './node/buffer/btoa.node';\n\nimport {Headers as HeadersNode} from './node/fetch/headers.node';\nimport {Response as ResponseNode} from './node/fetch/response.node';\nimport {fetchNode as fetchNode} from './node/fetch/fetch.node';\n\nimport {encodeImageNode} from './node/images/encode-image.node';\nimport {parseImageNode, NODE_FORMAT_SUPPORT} from './node/images/parse-image.node';\n\nexport {ReadableStreamPolyfill} from './node/file/readable-stream';\nexport {BlobPolyfill} from './node/file/blob';\nexport {FileReaderPolyfill} from './node/file/file-reader';\nexport {FilePolyfill} from './node/file/file';\nexport {installFilePolyfills} from './node/file/install-file-polyfills';\nexport {fetchNode as _fetchNode} from './node/fetch/fetch.node';\nexport {fetchFileNode as _fetchFileNode} from './node/fetch/fetch-file.node';\n\n// POLYFILLS: TextEncoder, TextDecoder\n// - Recent Node versions have these classes but virtually no encodings unless special build.\n// - Browser: Edge, IE11 do not have these\n\nconst installTextEncoder = !isBrowser || !('TextEncoder' in global);\nif (installTextEncoder) {\n global['TextEncoder'] = TextEncoder;\n}\n\nconst installTextDecoder = !isBrowser || !('TextDecoder' in global);\nif (installTextDecoder) {\n global['TextDecoder'] = TextDecoder;\n}\n\n// POLYFILLS: btoa, atob\n// - Node: Yes\n// - Browser: No\n\nif (!isBrowser && !('atob' in global) && base64.atob) {\n global['atob'] = base64.atob;\n}\nif (!isBrowser && !('btoa' in global) && base64.btoa) {\n global['btoa'] = base64.btoa;\n}\n\n// POLYFILL: fetch\n// - Node: Yes\n// - Browser: No. For This polyfill is node only, IE11 etc, install external polyfill\n\nif (!isBrowser && !('Headers' in global) && HeadersNode) {\n global['Headers'] = HeadersNode;\n}\n\nif (!isBrowser && !('Response' in global) && ResponseNode) {\n global['Response'] = ResponseNode;\n}\n\nif (!isBrowser && !('fetch' in global) && fetchNode) {\n global['fetch'] = fetchNode;\n}\n\n// POLYFILL: DOMParser\n// - Node: Yes\n// - Browser: No\n\nif (!isBrowser && !('DOMParser' in global) && DOMParser) {\n global['DOMParser'] = DOMParser;\n}\n\n// NODE IMAGE FUNCTIONS:\n// These are not official polyfills but used by the @loaders.gl/images module if installed\n// TODO - is there an appropriate Image API we could polyfill using an adapter?\n\nif (!isBrowser && !('_encodeImageNode' in global) && encodeImageNode) {\n global['_encodeImageNode'] = encodeImageNode;\n}\n\nif (!isBrowser && !('_parseImageNode' in global) && parseImageNode) {\n global['_parseImageNode'] = parseImageNode;\n global['_imageFormatsNode'] = NODE_FORMAT_SUPPORT;\n}\n\nif (!('allSettled' in Promise)) {\n // @ts-ignore\n Promise.allSettled = allSettled;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH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AIC,eAAM,CAAC,IAAIQ,gBAAS,EAAE;EACnDR,eAAM,CAAC,OAAO,CAAC,GAAGQ,gBAAS;AAC7B;AAMA,IAAI,CAACT,kBAAS,IAAI,EAAE,WAAW,IAAIC,eAAM,CAAC,IAAIS,iBAAS,EAAE;EACvDT,eAAM,CAAC,WAAW,CAAC,GAAGS,iBAAS;AACjC;AAMA,IAAI,CAACV,kBAAS,IAAI,EAAE,kBAAkB,IAAIC,eAAM,CAAC,IAAIU,4BAAe,EAAE;EACpEV,eAAM,CAAC,kBAAkB,CAAC,GAAGU,4BAAe;AAC9C;AAEA,IAAI,CAACX,kBAAS,IAAI,EAAE,iBAAiB,IAAIC,eAAM,CAAC,IAAIW,0BAAc,EAAE;EAClEX,eAAM,CAAC,iBAAiB,CAAC,GAAGW,0BAAc;EAC1CX,eAAM,CAAC,mBAAmB,CAAC,GAAGY,+BAAmB;AACnD;AAEA,IAAI,EAAE,YAAY,IAAIC,OAAO,CAAC,EAAE;EAE9BA,OAAO,CAACC,UAAU,GAAGA,sBAAU;AACjC"}
|
package/dist/es5/lib/encoding.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.TextDecoder = TextDecoder;
|
|
8
8
|
exports.TextEncoder = TextEncoder;
|
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
9
|
var _encodingIndexes = _interopRequireDefault(require("./encoding-indexes"));
|
|
11
10
|
global['encoding-indexes'] = _encodingIndexes.default || {};
|
|
12
11
|
function inRange(a, min, max) {
|
|
@@ -74,14 +73,14 @@ function Stream(tokens) {
|
|
|
74
73
|
this.tokens.reverse();
|
|
75
74
|
}
|
|
76
75
|
Stream.prototype = {
|
|
77
|
-
endOfStream: function
|
|
76
|
+
endOfStream: function () {
|
|
78
77
|
return !this.tokens.length;
|
|
79
78
|
},
|
|
80
|
-
read: function
|
|
79
|
+
read: function () {
|
|
81
80
|
if (!this.tokens.length) return end_of_stream;
|
|
82
81
|
return this.tokens.pop();
|
|
83
82
|
},
|
|
84
|
-
prepend: function
|
|
83
|
+
prepend: function (token) {
|
|
85
84
|
if (Array.isArray(token)) {
|
|
86
85
|
var tokens = token;
|
|
87
86
|
while (tokens.length) this.tokens.push(tokens.pop());
|
|
@@ -89,7 +88,7 @@ Stream.prototype = {
|
|
|
89
88
|
this.tokens.push(token);
|
|
90
89
|
}
|
|
91
90
|
},
|
|
92
|
-
push: function
|
|
91
|
+
push: function (token) {
|
|
93
92
|
if (Array.isArray(token)) {
|
|
94
93
|
var tokens = token;
|
|
95
94
|
while (tokens.length) this.tokens.unshift(tokens.shift());
|
|
@@ -108,11 +107,11 @@ function encoderError(code_point) {
|
|
|
108
107
|
}
|
|
109
108
|
function Decoder() {}
|
|
110
109
|
Decoder.prototype = {
|
|
111
|
-
handler: function
|
|
110
|
+
handler: function (stream, bite) {}
|
|
112
111
|
};
|
|
113
112
|
function Encoder() {}
|
|
114
113
|
Encoder.prototype = {
|
|
115
|
-
handler: function
|
|
114
|
+
handler: function (stream, code_point) {}
|
|
116
115
|
};
|
|
117
116
|
function getEncoding(label) {
|
|
118
117
|
label = String(label).trim().toLowerCase();
|
|
@@ -370,26 +369,26 @@ function TextDecoder(label, options) {
|
|
|
370
369
|
}
|
|
371
370
|
if (Object.defineProperty) {
|
|
372
371
|
Object.defineProperty(TextDecoder.prototype, 'encoding', {
|
|
373
|
-
get: function
|
|
372
|
+
get: function () {
|
|
374
373
|
return this._encoding.name.toLowerCase();
|
|
375
374
|
}
|
|
376
375
|
});
|
|
377
376
|
Object.defineProperty(TextDecoder.prototype, 'fatal', {
|
|
378
|
-
get: function
|
|
377
|
+
get: function () {
|
|
379
378
|
return this._error_mode === 'fatal';
|
|
380
379
|
}
|
|
381
380
|
});
|
|
382
381
|
Object.defineProperty(TextDecoder.prototype, 'ignoreBOM', {
|
|
383
|
-
get: function
|
|
382
|
+
get: function () {
|
|
384
383
|
return this._ignoreBOM;
|
|
385
384
|
}
|
|
386
385
|
});
|
|
387
386
|
}
|
|
388
387
|
TextDecoder.prototype.decode = function decode(input, options) {
|
|
389
388
|
var bytes;
|
|
390
|
-
if (
|
|
389
|
+
if (typeof input === 'object' && input instanceof ArrayBuffer) {
|
|
391
390
|
bytes = new Uint8Array(input);
|
|
392
|
-
} else if (
|
|
391
|
+
} else if (typeof input === 'object' && 'buffer' in input && input.buffer instanceof ArrayBuffer) {
|
|
393
392
|
bytes = new Uint8Array(input.buffer, input.byteOffset, input.byteLength);
|
|
394
393
|
} else {
|
|
395
394
|
bytes = new Uint8Array(0);
|
|
@@ -463,7 +462,7 @@ function TextEncoder(label, options) {
|
|
|
463
462
|
}
|
|
464
463
|
if (Object.defineProperty) {
|
|
465
464
|
Object.defineProperty(TextEncoder.prototype, 'encoding', {
|
|
466
|
-
get: function
|
|
465
|
+
get: function () {
|
|
467
466
|
return this._encoding.name.toLowerCase();
|
|
468
467
|
}
|
|
469
468
|
});
|