@loaders.gl/polyfills 4.0.0-alpha.6 → 4.0.0-alpha.7
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.min.js +1 -2337
- package/dist/es5/index.js +0 -4
- package/dist/es5/index.js.map +1 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -7
- package/package.json +2 -3
- package/src/index.ts +0 -9
package/dist/es5/index.js
CHANGED
|
@@ -46,7 +46,6 @@ Object.defineProperty(exports, "installFilePolyfills", {
|
|
|
46
46
|
return _installFilePolyfills.installFilePolyfills;
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
var _xmldom = require("@xmldom/xmldom");
|
|
50
49
|
var _globals = require("./utils/globals");
|
|
51
50
|
var _encoding = require("./lib/encoding");
|
|
52
51
|
var _allSettled = require("./promise/all-settled");
|
|
@@ -87,9 +86,6 @@ if (!_globals.isBrowser && !('Response' in _globals.global) && _response.Respons
|
|
|
87
86
|
if (!_globals.isBrowser && !('fetch' in _globals.global) && _fetch.fetchNode) {
|
|
88
87
|
_globals.global['fetch'] = _fetch.fetchNode;
|
|
89
88
|
}
|
|
90
|
-
if (!_globals.isBrowser && !('DOMParser' in _globals.global) && _xmldom.DOMParser) {
|
|
91
|
-
_globals.global['DOMParser'] = _xmldom.DOMParser;
|
|
92
|
-
}
|
|
93
89
|
if (!_globals.isBrowser && !('_encodeImageNode' in _globals.global) && _encodeImage.encodeImageNode) {
|
|
94
90
|
_globals.global['_encodeImageNode'] = _encodeImage.encodeImageNode;
|
|
95
91
|
}
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_globals","require","_encoding","_allSettled","base64","_interopRequireWildcard","_headers","_response","_fetch","_encodeImage","_parseImage","_readableStream","_blob","_fileReader","_file","_installFilePolyfills","_fetchFile","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","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","encodeImageNode","parseImageNode","NODE_FORMAT_SUPPORT","Promise","allSettled"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable dot-notation */\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// 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,QAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAGA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAEA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAEA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAEA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,KAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,KAAA,GAAAb,OAAA;AACA,IAAAc,qBAAA,GAAAd,OAAA;AAEA,IAAAe,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eAAM,CAAC,mBAAmB,CAAC,GAAGW,+BAAmB;AACnD;AAEA,IAAI,EAAE,YAAY,IAAIC,OAAO,CAAC,EAAE;EAE9BA,OAAO,CAACC,UAAU,GAAGA,sBAAU;AACjC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DOMParser } from '@xmldom/xmldom';
|
|
2
1
|
import { isBrowser, global } from './utils/globals';
|
|
3
2
|
import { TextDecoder, TextEncoder } from './lib/encoding';
|
|
4
3
|
import { allSettled } from './promise/all-settled';
|
|
@@ -38,9 +37,6 @@ if (!isBrowser && !('Response' in global) && ResponseNode) {
|
|
|
38
37
|
if (!isBrowser && !('fetch' in global) && fetchNode) {
|
|
39
38
|
global['fetch'] = fetchNode;
|
|
40
39
|
}
|
|
41
|
-
if (!isBrowser && !('DOMParser' in global) && DOMParser) {
|
|
42
|
-
global['DOMParser'] = DOMParser;
|
|
43
|
-
}
|
|
44
40
|
if (!isBrowser && !('_encodeImageNode' in global) && encodeImageNode) {
|
|
45
41
|
global['_encodeImageNode'] = encodeImageNode;
|
|
46
42
|
}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["isBrowser","global","TextDecoder","TextEncoder","allSettled","base64","Headers","HeadersNode","Response","ResponseNode","fetchNode","encodeImageNode","parseImageNode","NODE_FORMAT_SUPPORT","ReadableStreamPolyfill","BlobPolyfill","FileReaderPolyfill","FilePolyfill","installFilePolyfills","_fetchNode","fetchFileNode","_fetchFileNode","installTextEncoder","installTextDecoder","atob","btoa","Promise"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable dot-notation */\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// 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,SAAQA,SAAS,EAAEC,MAAM,QAAO,iBAAiB;AAEjD,SAAQC,WAAW,EAAEC,WAAW,QAAO,gBAAgB;AACvD,SAAQC,UAAU,QAAO,uBAAuB;AAGhD,OAAO,KAAKC,MAAM,MAAM,yBAAyB;AAEjD,SAAQC,OAAO,IAAIC,WAAW,QAAO,2BAA2B;AAChE,SAAQC,QAAQ,IAAIC,YAAY,QAAO,4BAA4B;AACnE,SAAQC,SAAsB,QAAO,yBAAyB;AAE9D,SAAQC,eAAe,QAAO,iCAAiC;AAC/D,SAAQC,cAAc,EAAEC,mBAAmB,QAAO,gCAAgC;AAElF,SAAQC,sBAAsB,QAAO,6BAA6B;AAClE,SAAQC,YAAY,QAAO,kBAAkB;AAC7C,SAAQC,kBAAkB,QAAO,yBAAyB;AAC1D,SAAQC,YAAY,QAAO,kBAAkB;AAC7C,SAAQC,oBAAoB,QAAO,oCAAoC;AACvE,SAAQR,SAAS,IAAIS,UAAU,QAAO,yBAAyB;AAC/D,SAAQC,aAAa,IAAIC,cAAc,QAAO,8BAA8B;AAM5E,MAAMC,kBAAkB,GAAG,CAACtB,SAAS,IAAI,EAAE,aAAa,IAAIC,MAAM,CAAC;AACnE,IAAIqB,kBAAkB,EAAE;EACtBrB,MAAM,CAAC,aAAa,CAAC,GAAGE,WAAW;AACrC;AAEA,MAAMoB,kBAAkB,GAAG,CAACvB,SAAS,IAAI,EAAE,aAAa,IAAIC,MAAM,CAAC;AACnE,IAAIsB,kBAAkB,EAAE;EACtBtB,MAAM,CAAC,aAAa,CAAC,GAAGC,WAAW;AACrC;AAMA,IAAI,CAACF,SAAS,IAAI,EAAE,MAAM,IAAIC,MAAM,CAAC,IAAII,MAAM,CAACmB,IAAI,EAAE;EACpDvB,MAAM,CAAC,MAAM,CAAC,GAAGI,MAAM,CAACmB,IAAI;AAC9B;AACA,IAAI,CAACxB,SAAS,IAAI,EAAE,MAAM,IAAIC,MAAM,CAAC,IAAII,MAAM,CAACoB,IAAI,EAAE;EACpDxB,MAAM,CAAC,MAAM,CAAC,GAAGI,MAAM,CAACoB,IAAI;AAC9B;AAMA,IAAI,CAACzB,SAAS,IAAI,EAAE,SAAS,IAAIC,MAAM,CAAC,IAAIM,WAAW,EAAE;EACvDN,MAAM,CAAC,SAAS,CAAC,GAAGM,WAAW;AACjC;AAEA,IAAI,CAACP,SAAS,IAAI,EAAE,UAAU,IAAIC,MAAM,CAAC,IAAIQ,YAAY,EAAE;EACzDR,MAAM,CAAC,UAAU,CAAC,GAAGQ,YAAY;AACnC;AAEA,IAAI,CAACT,SAAS,IAAI,EAAE,OAAO,IAAIC,MAAM,CAAC,IAAIS,SAAS,EAAE;EACnDT,MAAM,CAAC,OAAO,CAAC,GAAGS,SAAS;AAC7B;AAMA,IAAI,CAACV,SAAS,IAAI,EAAE,kBAAkB,IAAIC,MAAM,CAAC,IAAIU,eAAe,EAAE;EACpEV,MAAM,CAAC,kBAAkB,CAAC,GAAGU,eAAe;AAC9C;AAEA,IAAI,CAACX,SAAS,IAAI,EAAE,iBAAiB,IAAIC,MAAM,CAAC,IAAIW,cAAc,EAAE;EAClEX,MAAM,CAAC,iBAAiB,CAAC,GAAGW,cAAc;EAC1CX,MAAM,CAAC,mBAAmB,CAAC,GAAGY,mBAAmB;AACnD;AAEA,IAAI,EAAE,YAAY,IAAIa,OAAO,CAAC,EAAE;EAE9BA,OAAO,CAACtB,UAAU,GAAGA,UAAU;AACjC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAC,SAAS,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAC,aAAa,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports._fetchFileNode = exports._fetchNode = exports.installFilePolyfills = exports.FilePolyfill = exports.FileReaderPolyfill = exports.BlobPolyfill = exports.ReadableStreamPolyfill = void 0;
|
|
27
27
|
/* eslint-disable dot-notation */
|
|
28
|
-
const xmldom_1 = require("@xmldom/xmldom");
|
|
29
28
|
const globals_1 = require("./utils/globals");
|
|
30
29
|
const encoding_1 = require("./lib/encoding");
|
|
31
30
|
const all_settled_1 = require("./promise/all-settled");
|
|
@@ -82,12 +81,6 @@ if (!globals_1.isBrowser && !('Response' in globals_1.global) && response_node_1
|
|
|
82
81
|
if (!globals_1.isBrowser && !('fetch' in globals_1.global) && fetch_node_1.fetchNode) {
|
|
83
82
|
globals_1.global['fetch'] = fetch_node_1.fetchNode;
|
|
84
83
|
}
|
|
85
|
-
// POLYFILL: DOMParser
|
|
86
|
-
// - Node: Yes
|
|
87
|
-
// - Browser: No
|
|
88
|
-
if (!globals_1.isBrowser && !('DOMParser' in globals_1.global) && xmldom_1.DOMParser) {
|
|
89
|
-
globals_1.global['DOMParser'] = xmldom_1.DOMParser;
|
|
90
|
-
}
|
|
91
84
|
// NODE IMAGE FUNCTIONS:
|
|
92
85
|
// These are not official polyfills but used by the @loaders.gl/images module if installed
|
|
93
86
|
// TODO - is there an appropriate Image API we could polyfill using an adapter?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/polyfills",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.7",
|
|
4
4
|
"description": "Polyfills for TextEncoder/TextDecoder",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -97,7 +97,6 @@
|
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@babel/runtime": "^7.3.1",
|
|
100
|
-
"@xmldom/xmldom": "^0.7.5",
|
|
101
100
|
"buffer": "^6.0.3",
|
|
102
101
|
"get-pixels": "^3.3.2",
|
|
103
102
|
"ndarray": "^1.0.18",
|
|
@@ -106,5 +105,5 @@
|
|
|
106
105
|
"through": "^2.3.8",
|
|
107
106
|
"web-streams-polyfill": "^3.0.0"
|
|
108
107
|
},
|
|
109
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "afb59c4d8e5d8ebb9c28f111cb0c96c5527d0ffd"
|
|
110
109
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable dot-notation */
|
|
2
|
-
import {DOMParser} from '@xmldom/xmldom';
|
|
3
2
|
import {isBrowser, global} from './utils/globals';
|
|
4
3
|
|
|
5
4
|
import {TextDecoder, TextEncoder} from './lib/encoding';
|
|
@@ -64,14 +63,6 @@ if (!isBrowser && !('fetch' in global) && fetchNode) {
|
|
|
64
63
|
global['fetch'] = fetchNode;
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
// POLYFILL: DOMParser
|
|
68
|
-
// - Node: Yes
|
|
69
|
-
// - Browser: No
|
|
70
|
-
|
|
71
|
-
if (!isBrowser && !('DOMParser' in global) && DOMParser) {
|
|
72
|
-
global['DOMParser'] = DOMParser;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
66
|
// NODE IMAGE FUNCTIONS:
|
|
76
67
|
// These are not official polyfills but used by the @loaders.gl/images module if installed
|
|
77
68
|
// TODO - is there an appropriate Image API we could polyfill using an adapter?
|