@loaders.gl/polyfills 4.0.0-alpha.9 → 4.0.0-beta.2

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 (67) hide show
  1. package/dist/dist.min.js +10 -1818
  2. package/dist/es5/filesystems/node-filesystem.js +214 -0
  3. package/dist/es5/filesystems/node-filesystem.js.map +1 -0
  4. package/dist/es5/index.browser.js +15 -0
  5. package/dist/es5/index.browser.js.map +1 -0
  6. package/dist/es5/index.js +32 -49
  7. package/dist/es5/index.js.map +1 -1
  8. package/dist/es5/node/fetch/fetch.node.js +2 -3
  9. package/dist/es5/node/fetch/fetch.node.js.map +1 -1
  10. package/dist/es5/node/file/install-file-polyfills.js +1 -4
  11. package/dist/es5/node/file/install-file-polyfills.js.map +1 -1
  12. package/dist/esm/filesystems/node-filesystem.js +56 -0
  13. package/dist/esm/filesystems/node-filesystem.js.map +1 -0
  14. package/dist/esm/index.browser.js +7 -0
  15. package/dist/esm/index.browser.js.map +1 -0
  16. package/dist/esm/index.js +32 -31
  17. package/dist/esm/index.js.map +1 -1
  18. package/dist/esm/node/fetch/fetch.node.js +2 -3
  19. package/dist/esm/node/fetch/fetch.node.js.map +1 -1
  20. package/dist/esm/node/file/install-file-polyfills.js +1 -4
  21. package/dist/esm/node/file/install-file-polyfills.js.map +1 -1
  22. package/dist/filesystems/node-filesystem.d.ts +39 -0
  23. package/dist/filesystems/node-filesystem.d.ts.map +1 -0
  24. package/dist/index.browser.d.ts +3 -0
  25. package/dist/index.browser.d.ts.map +1 -0
  26. package/dist/index.d.ts +1 -4
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/node/fetch/fetch.node.d.ts +1 -1
  29. package/dist/node/fetch/fetch.node.d.ts.map +1 -1
  30. package/package.json +6 -66
  31. package/src/filesystems/node-filesystem.ts +87 -0
  32. package/src/index.browser.ts +14 -0
  33. package/src/index.ts +54 -38
  34. package/src/node/fetch/fetch.node.ts +6 -5
  35. package/src/node/file/install-file-polyfills.ts +2 -2
  36. package/dist/bundle.js +0 -5
  37. package/dist/es5/node/fetch/fetch-file.node.js +0 -83
  38. package/dist/es5/node/fetch/fetch-file.node.js.map +0 -1
  39. package/dist/esm/node/fetch/fetch-file.node.js +0 -50
  40. package/dist/esm/node/fetch/fetch-file.node.js.map +0 -1
  41. package/dist/index.js +0 -97
  42. package/dist/lib/encoding-indexes.js +0 -35
  43. package/dist/lib/encoding.js +0 -2779
  44. package/dist/libs/encoding-indexes-asian.js +0 -14
  45. package/dist/node/buffer/btoa.node.js +0 -14
  46. package/dist/node/buffer/to-array-buffer.node.js +0 -12
  47. package/dist/node/fetch/fetch-file.node.d.ts +0 -4
  48. package/dist/node/fetch/fetch-file.node.d.ts.map +0 -1
  49. package/dist/node/fetch/fetch-file.node.js +0 -51
  50. package/dist/node/fetch/fetch.node.js +0 -143
  51. package/dist/node/fetch/headers.node.js +0 -106
  52. package/dist/node/fetch/response.node.js +0 -76
  53. package/dist/node/fetch/utils/decode-data-uri.node.js +0 -65
  54. package/dist/node/fetch/utils/stream-utils.node.js +0 -73
  55. package/dist/node/file/blob-stream-controller.js +0 -63
  56. package/dist/node/file/blob-stream.js +0 -37
  57. package/dist/node/file/blob.js +0 -160
  58. package/dist/node/file/file-reader.js +0 -35
  59. package/dist/node/file/file.js +0 -37
  60. package/dist/node/file/install-file-polyfills.js +0 -27
  61. package/dist/node/file/readable-stream.js +0 -11
  62. package/dist/node/images/encode-image.node.js +0 -41
  63. package/dist/node/images/parse-image.node.js +0 -41
  64. package/dist/promise/all-settled.js +0 -24
  65. package/dist/utils/assert.js +0 -9
  66. package/dist/utils/globals.js +0 -36
  67. package/src/node/fetch/fetch-file.node.ts +0 -51
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable dot-notation */
2
- import {isBrowser, global} from './utils/globals';
2
+ import {isBrowser} from './utils/globals';
3
3
 
4
4
  import {TextDecoder, TextEncoder} from './lib/encoding';
5
5
  import {allSettled} from './promise/all-settled';
@@ -7,76 +7,92 @@ import {allSettled} from './promise/all-settled';
7
7
  // Node specific
8
8
  import * as base64 from './node/buffer/btoa.node';
9
9
 
10
- import {Headers as HeadersNode} from './node/fetch/headers.node';
11
- import {Response as ResponseNode} from './node/fetch/response.node';
12
- import {fetchNode as fetchNode} from './node/fetch/fetch.node';
13
-
14
10
  import {encodeImageNode} from './node/images/encode-image.node';
15
11
  import {parseImageNode, NODE_FORMAT_SUPPORT} from './node/images/parse-image.node';
16
12
 
17
- export {ReadableStreamPolyfill} from './node/file/readable-stream';
18
- export {BlobPolyfill} from './node/file/blob';
13
+ // export {ReadableStreamPolyfill} from './node/file/readable-stream';
14
+ // export {BlobPolyfill} from './node/file/blob';
19
15
  export {FileReaderPolyfill} from './node/file/file-reader';
20
16
  export {FilePolyfill} from './node/file/file';
21
17
  export {installFilePolyfills} from './node/file/install-file-polyfills';
22
- export {fetchNode as _fetchNode} from './node/fetch/fetch.node';
23
- export {fetchFileNode as _fetchFileNode} from './node/fetch/fetch-file.node';
18
+
19
+ if (isBrowser) {
20
+ // eslint-disable-next-line no-console
21
+ console.error(
22
+ 'loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments'
23
+ );
24
+ }
24
25
 
25
26
  // POLYFILLS: TextEncoder, TextDecoder
26
27
  // - Recent Node versions have these classes but virtually no encodings unless special build.
27
28
  // - Browser: Edge, IE11 do not have these
28
29
 
29
- const installTextEncoder = !isBrowser || !('TextEncoder' in global);
30
- if (installTextEncoder) {
31
- global['TextEncoder'] = TextEncoder;
30
+ if (!globalThis.TextEncoder) {
31
+ // @ts-expect-error
32
+ globalThis.TextEncoder = TextEncoder;
32
33
  }
33
34
 
34
- const installTextDecoder = !isBrowser || !('TextDecoder' in global);
35
- if (installTextDecoder) {
36
- global['TextDecoder'] = TextDecoder;
35
+ if (!globalThis.TextDecoder) {
36
+ // @ts-expect-error
37
+ globalThis.TextDecoder = TextDecoder;
37
38
  }
38
39
 
39
40
  // POLYFILLS: btoa, atob
40
41
  // - Node: Yes
41
42
  // - Browser: No
42
43
 
43
- if (!isBrowser && !('atob' in global) && base64.atob) {
44
- global['atob'] = base64.atob;
44
+ if (!isBrowser && !('atob' in globalThis) && base64.atob) {
45
+ globalThis['atob'] = base64.atob;
45
46
  }
46
- if (!isBrowser && !('btoa' in global) && base64.btoa) {
47
- global['btoa'] = base64.btoa;
47
+ if (!isBrowser && !('btoa' in globalThis) && base64.btoa) {
48
+ globalThis['btoa'] = base64.btoa;
48
49
  }
49
50
 
50
- // POLYFILL: fetch
51
- // - Node: Yes
52
- // - Browser: No. For This polyfill is node only, IE11 etc, install external polyfill
53
-
54
- if (!isBrowser && !('Headers' in global) && HeadersNode) {
55
- global['Headers'] = HeadersNode;
56
- }
57
-
58
- if (!isBrowser && !('Response' in global) && ResponseNode) {
59
- global['Response'] = ResponseNode;
60
- }
51
+ globalThis.loaders = globalThis.loaders || {};
61
52
 
62
- if (!isBrowser && !('fetch' in global) && fetchNode) {
63
- global['fetch'] = fetchNode;
64
- }
53
+ // FILESYSTEM POLYFILLS:
54
+ export {NodeFileSystem} from './filesystems/node-filesystem';
55
+ import {NodeFileSystem} from './filesystems/node-filesystem';
56
+ globalThis.loaders.NodeFileSystem = NodeFileSystem;
65
57
 
66
58
  // NODE IMAGE FUNCTIONS:
67
59
  // These are not official polyfills but used by the @loaders.gl/images module if installed
68
60
  // TODO - is there an appropriate Image API we could polyfill using an adapter?
69
61
 
70
- if (!isBrowser && !('_encodeImageNode' in global) && encodeImageNode) {
71
- global['_encodeImageNode'] = encodeImageNode;
62
+ if (!isBrowser && !('_encodeImageNode' in globalThis) && encodeImageNode) {
63
+ globalThis['_encodeImageNode'] = encodeImageNode;
72
64
  }
73
65
 
74
- if (!isBrowser && !('_parseImageNode' in global) && parseImageNode) {
75
- global['_parseImageNode'] = parseImageNode;
76
- global['_imageFormatsNode'] = NODE_FORMAT_SUPPORT;
66
+ if (!isBrowser && !('_parseImageNode' in globalThis) && parseImageNode) {
67
+ globalThis['_parseImageNode'] = parseImageNode;
68
+ globalThis['_imageFormatsNode'] = NODE_FORMAT_SUPPORT;
77
69
  }
78
70
 
79
71
  if (!('allSettled' in Promise)) {
80
72
  // @ts-ignore
81
73
  Promise.allSettled = allSettled;
82
74
  }
75
+
76
+ // DEPRECATED POLYFILL:
77
+ // - Node v18+: No, not needed
78
+ // - Node v16 and lower: Yes
79
+ // - Browsers (evergreen): Not needed.
80
+ // - IE11: No. This polyfill is node only, install external polyfill
81
+ import {Headers as HeadersNode} from './node/fetch/headers.node';
82
+ import {Response as ResponseNode} from './node/fetch/response.node';
83
+ import {fetchNode as fetchNode} from './node/fetch/fetch.node';
84
+
85
+ if (!isBrowser && !('Headers' in globalThis) && HeadersNode) {
86
+ // @ts-expect-error
87
+ globalThis.Headers = HeadersNode;
88
+ }
89
+
90
+ if (!isBrowser && !('Response' in globalThis) && ResponseNode) {
91
+ // @ts-expect-error
92
+ globalThis.Response = ResponseNode;
93
+ }
94
+
95
+ if (!isBrowser && !('fetch' in globalThis) && fetchNode) {
96
+ // @ts-expect-error
97
+ globalThis.fetch = fetchNode;
98
+ }
@@ -6,8 +6,6 @@ import {Response} from './response.node';
6
6
  import {Headers} from './headers.node';
7
7
  import {decodeDataUri} from './utils/decode-data-uri.node';
8
8
 
9
- import {fetchFileNode} from './fetch-file.node';
10
-
11
9
  const isDataURL = (url: string): boolean => url.startsWith('data:');
12
10
  const isRequestURL = (url: string): boolean => url.startsWith('http:') || url.startsWith('https:');
13
11
 
@@ -17,11 +15,13 @@ const isRequestURL = (url: string): boolean => url.startsWith('http:') || url.st
17
15
  * @param options
18
16
  */
19
17
  // eslint-disable-next-line complexity
20
- export async function fetchNode(url: string, options): Promise<Response> {
18
+ export async function fetchNode(url: string, options: RequestInit): Promise<Response> {
21
19
  try {
22
20
  // Handle file streams in node
23
- if (!isRequestURL(url) && !isDataURL(url)) {
24
- return await fetchFileNode(url, options);
21
+ // @ts-expect-error
22
+ if (globalThis.fetch !== fetchNode && (isRequestURL(url) || isDataURL(url))) {
23
+ // @ts-expect-error
24
+ return await fetch(url, options);
25
25
  }
26
26
 
27
27
  // Handle data urls in node, to match `fetch``
@@ -49,6 +49,7 @@ export async function fetchNode(url: string, options): Promise<Response> {
49
49
  const {status, statusText} = getStatus(body);
50
50
 
51
51
  const followRedirect =
52
+ // @ts-expect-error
52
53
  !options || options.followRedirect || options.followRedirect === undefined;
53
54
 
54
55
  if (status >= 300 && status < 400 && headers.has('location') && followRedirect) {
@@ -1,4 +1,4 @@
1
- import {ReadableStreamPolyfill} from './readable-stream';
1
+ // import {ReadableStreamPolyfill} from './readable-stream';
2
2
  import {BlobPolyfill} from './blob';
3
3
  import {FileReaderPolyfill} from './file-reader';
4
4
  import {FilePolyfill} from './file';
@@ -6,7 +6,7 @@ import {FilePolyfill} from './file';
6
6
  export function installFilePolyfills() {
7
7
  if (typeof ReadableStream === 'undefined' && global) {
8
8
  // @ts-ignore;
9
- global.ReadableStream = ReadableStreamPolyfill;
9
+ // global.ReadableStream = ReadableStreamPolyfill;
10
10
  }
11
11
 
12
12
  if (typeof Blob === 'undefined' && global) {
package/dist/bundle.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- const moduleExports = require('./index');
4
- globalThis.loaders = globalThis.loaders || {};
5
- module.exports = Object.assign(globalThis.loaders, moduleExports);
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.fetchFileNode = fetchFileNode;
8
- exports.isRequestURL = isRequestURL;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
- var _fs = _interopRequireDefault(require("fs"));
12
- var _response = require("./response.node");
13
- var _headers2 = require("./headers.node");
14
- function isRequestURL(url) {
15
- return url.startsWith('http:') || url.startsWith('https:');
16
- }
17
- function fetchFileNode(_x, _x2) {
18
- return _fetchFileNode.apply(this, arguments);
19
- }
20
- function _fetchFileNode() {
21
- _fetchFileNode = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(url, options) {
22
- var noqueryUrl, body, status, statusText, headers, _status, _statusText, _headers;
23
- return _regenerator.default.wrap(function _callee$(_context) {
24
- while (1) switch (_context.prev = _context.next) {
25
- case 0:
26
- noqueryUrl = url.split('?')[0];
27
- _context.prev = 1;
28
- _context.next = 4;
29
- return new Promise(function (resolve, reject) {
30
- var stream = _fs.default.createReadStream(noqueryUrl, {
31
- encoding: null
32
- });
33
- stream.once('readable', function () {
34
- return resolve(stream);
35
- });
36
- stream.on('error', function (error) {
37
- return reject(error);
38
- });
39
- });
40
- case 4:
41
- body = _context.sent;
42
- status = 200;
43
- statusText = 'OK';
44
- headers = getHeadersForFile(noqueryUrl);
45
- return _context.abrupt("return", new _response.Response(body, {
46
- headers: headers,
47
- status: status,
48
- statusText: statusText,
49
- url: url
50
- }));
51
- case 11:
52
- _context.prev = 11;
53
- _context.t0 = _context["catch"](1);
54
- _status = 400;
55
- _statusText = _context.t0.message;
56
- _headers = {};
57
- return _context.abrupt("return", new _response.Response(_context.t0.message, {
58
- headers: _headers,
59
- status: _status,
60
- statusText: _statusText,
61
- url: url
62
- }));
63
- case 17:
64
- case "end":
65
- return _context.stop();
66
- }
67
- }, _callee, null, [[1, 11]]);
68
- }));
69
- return _fetchFileNode.apply(this, arguments);
70
- }
71
- function getHeadersForFile(noqueryUrl) {
72
- var headers = {};
73
- if (!headers['content-length']) {
74
- var stats = _fs.default.statSync(noqueryUrl);
75
- headers['content-length'] = stats.size;
76
- }
77
- if (noqueryUrl.endsWith('.gz')) {
78
- noqueryUrl = noqueryUrl.slice(0, -3);
79
- headers['content-encoding'] = 'gzip';
80
- }
81
- return new _headers2.Headers(headers);
82
- }
83
- //# sourceMappingURL=fetch-file.node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-file.node.js","names":["_fs","_interopRequireDefault","require","_response","_headers2","isRequestURL","url","startsWith","fetchFileNode","_x","_x2","_fetchFileNode","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","options","noqueryUrl","body","status","statusText","headers","_status","_statusText","_headers","wrap","_callee$","_context","prev","next","split","Promise","resolve","reject","stream","fs","createReadStream","encoding","once","on","error","sent","getHeadersForFile","abrupt","Response","t0","message","stop","stats","statSync","size","endsWith","slice","Headers"],"sources":["../../../../src/node/fetch/fetch-file.node.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport fs from 'fs'; // `fs` will be empty object in browsers (see package.json \"browser\" field).\nimport {Response} from './response.node';\nimport {Headers} from './headers.node';\n\nexport function isRequestURL(url: string): boolean {\n return url.startsWith('http:') || url.startsWith('https:');\n}\n\nexport async function fetchFileNode(url: string, options): Promise<Response> {\n const noqueryUrl = url.split('?')[0];\n\n try {\n // Now open the stream\n const body = await new Promise((resolve, reject) => {\n // @ts-ignore\n const stream = fs.createReadStream(noqueryUrl, {encoding: null});\n stream.once('readable', () => resolve(stream));\n stream.on('error', (error) => reject(error));\n });\n\n const status = 200;\n const statusText = 'OK';\n const headers = getHeadersForFile(noqueryUrl);\n return new Response(body, {headers, status, statusText, url});\n } catch (error) {\n const status = 400;\n const statusText = (error as Error).message;\n const headers = {};\n return new Response((error as Error).message, {headers, status, statusText, url});\n }\n}\n\nfunction getHeadersForFile(noqueryUrl: string): Headers {\n const headers = {};\n\n // Fix up content length if we can for best progress experience\n if (!headers['content-length']) {\n const stats = fs.statSync(noqueryUrl);\n headers['content-length'] = stats.size;\n }\n\n // Automatically decompress gzipped files with .gz extension\n if (noqueryUrl.endsWith('.gz')) {\n noqueryUrl = noqueryUrl.slice(0, -3);\n headers['content-encoding'] = 'gzip';\n }\n\n return new Headers(headers);\n}\n"],"mappings":";;;;;;;;;;AAEA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OA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pC/B,OAAO,CAAC,kBAAkB,CAAC,GAAG,MAAM;EACtC;EAEA,OAAO,IAAIgC,iBAAO,CAAChC,OAAO,CAAC;AAC7B"}
@@ -1,50 +0,0 @@
1
- import fs from 'fs';
2
- import { Response } from './response.node';
3
- import { Headers } from './headers.node';
4
- export function isRequestURL(url) {
5
- return url.startsWith('http:') || url.startsWith('https:');
6
- }
7
- export async function fetchFileNode(url, options) {
8
- const noqueryUrl = url.split('?')[0];
9
- try {
10
- const body = await new Promise((resolve, reject) => {
11
- const stream = fs.createReadStream(noqueryUrl, {
12
- encoding: null
13
- });
14
- stream.once('readable', () => resolve(stream));
15
- stream.on('error', error => reject(error));
16
- });
17
- const status = 200;
18
- const statusText = 'OK';
19
- const headers = getHeadersForFile(noqueryUrl);
20
- return new Response(body, {
21
- headers,
22
- status,
23
- statusText,
24
- url
25
- });
26
- } catch (error) {
27
- const status = 400;
28
- const statusText = error.message;
29
- const headers = {};
30
- return new Response(error.message, {
31
- headers,
32
- status,
33
- statusText,
34
- url
35
- });
36
- }
37
- }
38
- function getHeadersForFile(noqueryUrl) {
39
- const headers = {};
40
- if (!headers['content-length']) {
41
- const stats = fs.statSync(noqueryUrl);
42
- headers['content-length'] = stats.size;
43
- }
44
- if (noqueryUrl.endsWith('.gz')) {
45
- noqueryUrl = noqueryUrl.slice(0, -3);
46
- headers['content-encoding'] = 'gzip';
47
- }
48
- return new Headers(headers);
49
- }
50
- //# sourceMappingURL=fetch-file.node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-file.node.js","names":["fs","Response","Headers","isRequestURL","url","startsWith","fetchFileNode","options","noqueryUrl","split","body","Promise","resolve","reject","stream","createReadStream","encoding","once","on","error","status","statusText","headers","getHeadersForFile","message","stats","statSync","size","endsWith","slice"],"sources":["../../../../src/node/fetch/fetch-file.node.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport fs from 'fs'; // `fs` will be empty object in browsers (see package.json \"browser\" field).\nimport {Response} from './response.node';\nimport {Headers} from './headers.node';\n\nexport function isRequestURL(url: string): boolean {\n return url.startsWith('http:') || url.startsWith('https:');\n}\n\nexport async function fetchFileNode(url: string, options): Promise<Response> {\n const noqueryUrl = url.split('?')[0];\n\n try {\n // Now open the stream\n const body = await new Promise((resolve, reject) => {\n // @ts-ignore\n const stream = fs.createReadStream(noqueryUrl, {encoding: null});\n stream.once('readable', () => resolve(stream));\n stream.on('error', (error) => reject(error));\n });\n\n const status = 200;\n const statusText = 'OK';\n const headers = getHeadersForFile(noqueryUrl);\n return new Response(body, {headers, status, statusText, url});\n } catch (error) {\n const status = 400;\n const statusText = (error as Error).message;\n const headers = {};\n return new Response((error as Error).message, {headers, status, statusText, url});\n }\n}\n\nfunction getHeadersForFile(noqueryUrl: string): Headers {\n const headers = {};\n\n // Fix up content length if we can for best progress experience\n if (!headers['content-length']) {\n const stats = fs.statSync(noqueryUrl);\n headers['content-length'] = stats.size;\n }\n\n // Automatically decompress gzipped files with .gz extension\n if (noqueryUrl.endsWith('.gz')) {\n noqueryUrl = noqueryUrl.slice(0, -3);\n headers['content-encoding'] = 'gzip';\n }\n\n return new Headers(headers);\n}\n"],"mappings":"AAEA,OAAOA,EAAE,MAAM,IAAI;AACnB,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,OAAO,QAAO,gBAAgB;AAEtC,OAAO,SAASC,YAAYA,CAACC,GAAW,EAAW;EACjD,OAAOA,GAAG,CAACC,UAAU,CAAC,OAAO,CAAC,IAAID,GAAG,CAACC,UAAU,CAAC,QAAQ,CAAC;AAC5D;AAEA,OAAO,eAAeC,aAAaA,CAACF,GAAW,EAAEG,OAAO,EAAqB;EAC3E,MAAMC,UAAU,GAAGJ,GAAG,CAACK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAEpC,IAAI;IAEF,MAAMC,IAAI,GAAG,MAAM,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MAElD,MAAMC,MAAM,GAAGd,EAAE,C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,OAAO,IAAIpB,OAAO,CAACoB,OAAO,CAAC;AAC7B"}
package/dist/index.js DELETED
@@ -1,97 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports._fetchFileNode = exports._fetchNode = exports.installFilePolyfills = exports.FilePolyfill = exports.FileReaderPolyfill = exports.BlobPolyfill = exports.ReadableStreamPolyfill = void 0;
27
- /* eslint-disable dot-notation */
28
- const globals_1 = require("./utils/globals");
29
- const encoding_1 = require("./lib/encoding");
30
- const all_settled_1 = require("./promise/all-settled");
31
- // Node specific
32
- const base64 = __importStar(require("./node/buffer/btoa.node"));
33
- const headers_node_1 = require("./node/fetch/headers.node");
34
- const response_node_1 = require("./node/fetch/response.node");
35
- const fetch_node_1 = require("./node/fetch/fetch.node");
36
- const encode_image_node_1 = require("./node/images/encode-image.node");
37
- const parse_image_node_1 = require("./node/images/parse-image.node");
38
- var readable_stream_1 = require("./node/file/readable-stream");
39
- Object.defineProperty(exports, "ReadableStreamPolyfill", { enumerable: true, get: function () { return readable_stream_1.ReadableStreamPolyfill; } });
40
- var blob_1 = require("./node/file/blob");
41
- Object.defineProperty(exports, "BlobPolyfill", { enumerable: true, get: function () { return blob_1.BlobPolyfill; } });
42
- var file_reader_1 = require("./node/file/file-reader");
43
- Object.defineProperty(exports, "FileReaderPolyfill", { enumerable: true, get: function () { return file_reader_1.FileReaderPolyfill; } });
44
- var file_1 = require("./node/file/file");
45
- Object.defineProperty(exports, "FilePolyfill", { enumerable: true, get: function () { return file_1.FilePolyfill; } });
46
- var install_file_polyfills_1 = require("./node/file/install-file-polyfills");
47
- Object.defineProperty(exports, "installFilePolyfills", { enumerable: true, get: function () { return install_file_polyfills_1.installFilePolyfills; } });
48
- var fetch_node_2 = require("./node/fetch/fetch.node");
49
- Object.defineProperty(exports, "_fetchNode", { enumerable: true, get: function () { return fetch_node_2.fetchNode; } });
50
- var fetch_file_node_1 = require("./node/fetch/fetch-file.node");
51
- Object.defineProperty(exports, "_fetchFileNode", { enumerable: true, get: function () { return fetch_file_node_1.fetchFileNode; } });
52
- // POLYFILLS: TextEncoder, TextDecoder
53
- // - Recent Node versions have these classes but virtually no encodings unless special build.
54
- // - Browser: Edge, IE11 do not have these
55
- const installTextEncoder = !globals_1.isBrowser || !('TextEncoder' in globals_1.global);
56
- if (installTextEncoder) {
57
- globals_1.global['TextEncoder'] = encoding_1.TextEncoder;
58
- }
59
- const installTextDecoder = !globals_1.isBrowser || !('TextDecoder' in globals_1.global);
60
- if (installTextDecoder) {
61
- globals_1.global['TextDecoder'] = encoding_1.TextDecoder;
62
- }
63
- // POLYFILLS: btoa, atob
64
- // - Node: Yes
65
- // - Browser: No
66
- if (!globals_1.isBrowser && !('atob' in globals_1.global) && base64.atob) {
67
- globals_1.global['atob'] = base64.atob;
68
- }
69
- if (!globals_1.isBrowser && !('btoa' in globals_1.global) && base64.btoa) {
70
- globals_1.global['btoa'] = base64.btoa;
71
- }
72
- // POLYFILL: fetch
73
- // - Node: Yes
74
- // - Browser: No. For This polyfill is node only, IE11 etc, install external polyfill
75
- if (!globals_1.isBrowser && !('Headers' in globals_1.global) && headers_node_1.Headers) {
76
- globals_1.global['Headers'] = headers_node_1.Headers;
77
- }
78
- if (!globals_1.isBrowser && !('Response' in globals_1.global) && response_node_1.Response) {
79
- globals_1.global['Response'] = response_node_1.Response;
80
- }
81
- if (!globals_1.isBrowser && !('fetch' in globals_1.global) && fetch_node_1.fetchNode) {
82
- globals_1.global['fetch'] = fetch_node_1.fetchNode;
83
- }
84
- // NODE IMAGE FUNCTIONS:
85
- // These are not official polyfills but used by the @loaders.gl/images module if installed
86
- // TODO - is there an appropriate Image API we could polyfill using an adapter?
87
- if (!globals_1.isBrowser && !('_encodeImageNode' in globals_1.global) && encode_image_node_1.encodeImageNode) {
88
- globals_1.global['_encodeImageNode'] = encode_image_node_1.encodeImageNode;
89
- }
90
- if (!globals_1.isBrowser && !('_parseImageNode' in globals_1.global) && parse_image_node_1.parseImageNode) {
91
- globals_1.global['_parseImageNode'] = parse_image_node_1.parseImageNode;
92
- globals_1.global['_imageFormatsNode'] = parse_image_node_1.NODE_FORMAT_SUPPORT;
93
- }
94
- if (!('allSettled' in Promise)) {
95
- // @ts-ignore
96
- Promise.allSettled = all_settled_1.allSettled;
97
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- /* eslint-disable */
3
- // Copied from https://github.com/inexorabletash/text-encoding/blob/b4e5bc26e26e51f56e3daa9f13138c79f49d3c34/lib/encoding-indexes.js
4
- // License: Public domain https://github.com/inexorabletash/text-encoding/blob/b4e5bc26e26e51f56e3daa9f13138c79f49d3c34/LICENSE.md
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- // prettier-ignore
7
- exports.default = {
8
- "ibm866": [1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 9617, 9618, 9619, 9474, 9508, 9569, 9570, 9558, 9557, 9571, 9553, 9559, 9565, 9564, 9563, 9488, 9492, 9524, 9516, 9500, 9472, 9532, 9566, 9567, 9562, 9556, 9577, 9574, 9568, 9552, 9580, 9575, 9576, 9572, 9573, 9561, 9560, 9554, 9555, 9579, 9578, 9496, 9484, 9608, 9604, 9612, 9616, 9600, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1025, 1105, 1028, 1108, 1031, 1111, 1038, 1118, 176, 8729, 183, 8730, 8470, 164, 9632, 160],
9
- "iso-8859-2": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 728, 321, 164, 317, 346, 167, 168, 352, 350, 356, 377, 173, 381, 379, 176, 261, 731, 322, 180, 318, 347, 711, 184, 353, 351, 357, 378, 733, 382, 380, 340, 193, 194, 258, 196, 313, 262, 199, 268, 201, 280, 203, 282, 205, 206, 270, 272, 323, 327, 211, 212, 336, 214, 215, 344, 366, 218, 368, 220, 221, 354, 223, 341, 225, 226, 259, 228, 314, 263, 231, 269, 233, 281, 235, 283, 237, 238, 271, 273, 324, 328, 243, 244, 337, 246, 247, 345, 367, 250, 369, 252, 253, 355, 729],
10
- "iso-8859-3": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 294, 728, 163, 164, null, 292, 167, 168, 304, 350, 286, 308, 173, null, 379, 176, 295, 178, 179, 180, 181, 293, 183, 184, 305, 351, 287, 309, 189, null, 380, 192, 193, 194, null, 196, 266, 264, 199, 200, 201, 202, 203, 204, 205, 206, 207, null, 209, 210, 211, 212, 288, 214, 215, 284, 217, 218, 219, 220, 364, 348, 223, 224, 225, 226, null, 228, 267, 265, 231, 232, 233, 234, 235, 236, 237, 238, 239, null, 241, 242, 243, 244, 289, 246, 247, 285, 249, 250, 251, 252, 365, 349, 729],
11
- "iso-8859-4": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 312, 342, 164, 296, 315, 167, 168, 352, 274, 290, 358, 173, 381, 175, 176, 261, 731, 343, 180, 297, 316, 711, 184, 353, 275, 291, 359, 330, 382, 331, 256, 193, 194, 195, 196, 197, 198, 302, 268, 201, 280, 203, 278, 205, 206, 298, 272, 325, 332, 310, 212, 213, 214, 215, 216, 370, 218, 219, 220, 360, 362, 223, 257, 225, 226, 227, 228, 229, 230, 303, 269, 233, 281, 235, 279, 237, 238, 299, 273, 326, 333, 311, 244, 245, 246, 247, 248, 371, 250, 251, 252, 361, 363, 729],
12
- "iso-8859-5": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 173, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 8470, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 167, 1118, 1119],
13
- "iso-8859-6": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, null, null, null, 164, null, null, null, null, null, null, null, 1548, 173, null, null, null, null, null, null, null, null, null, null, null, null, null, 1563, null, null, null, 1567, null, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, null, null, null, null, null, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, null, null, null, null, null, null, null, null, null, null, null, null, null],
14
- "iso-8859-7": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 8216, 8217, 163, 8364, 8367, 166, 167, 168, 169, 890, 171, 172, 173, null, 8213, 176, 177, 178, 179, 900, 901, 902, 183, 904, 905, 906, 187, 908, 189, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, null, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, null],
15
- "iso-8859-8": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, null, 162, 163, 164, 165, 166, 167, 168, 169, 215, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 247, 187, 188, 189, 190, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8215, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, null, null, 8206, 8207, null],
16
- "iso-8859-10": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 274, 290, 298, 296, 310, 167, 315, 272, 352, 358, 381, 173, 362, 330, 176, 261, 275, 291, 299, 297, 311, 183, 316, 273, 353, 359, 382, 8213, 363, 331, 256, 193, 194, 195, 196, 197, 198, 302, 268, 201, 280, 203, 278, 205, 206, 207, 208, 325, 332, 211, 212, 213, 214, 360, 216, 370, 218, 219, 220, 221, 222, 223, 257, 225, 226, 227, 228, 229, 230, 303, 269, 233, 281, 235, 279, 237, 238, 239, 240, 326, 333, 243, 244, 245, 246, 361, 248, 371, 250, 251, 252, 253, 254, 312],
17
- "iso-8859-13": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 8221, 162, 163, 164, 8222, 166, 167, 216, 169, 342, 171, 172, 173, 174, 198, 176, 177, 178, 179, 8220, 181, 182, 183, 248, 185, 343, 187, 188, 189, 190, 230, 260, 302, 256, 262, 196, 197, 280, 274, 268, 201, 377, 278, 290, 310, 298, 315, 352, 323, 325, 211, 332, 213, 214, 215, 370, 321, 346, 362, 220, 379, 381, 223, 261, 303, 257, 263, 228, 229, 281, 275, 269, 233, 378, 279, 291, 311, 299, 316, 353, 324, 326, 243, 333, 245, 246, 247, 371, 322, 347, 363, 252, 380, 382, 8217],
18
- "iso-8859-14": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 7682, 7683, 163, 266, 267, 7690, 167, 7808, 169, 7810, 7691, 7922, 173, 174, 376, 7710, 7711, 288, 289, 7744, 7745, 182, 7766, 7809, 7767, 7811, 7776, 7923, 7812, 7813, 7777, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 372, 209, 210, 211, 212, 213, 214, 7786, 216, 217, 218, 219, 220, 221, 374, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 373, 241, 242, 243, 244, 245, 246, 7787, 248, 249, 250, 251, 252, 253, 375, 255],
19
- "iso-8859-15": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 8364, 165, 352, 167, 353, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 381, 181, 182, 183, 382, 185, 186, 187, 338, 339, 376, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255],
20
- "iso-8859-16": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 261, 321, 8364, 8222, 352, 167, 353, 169, 536, 171, 377, 173, 378, 379, 176, 177, 268, 322, 381, 8221, 182, 183, 382, 269, 537, 187, 338, 339, 376, 380, 192, 193, 194, 258, 196, 262, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 272, 323, 210, 211, 212, 336, 214, 346, 368, 217, 218, 219, 220, 280, 538, 223, 224, 225, 226, 259, 228, 263, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 273, 324, 242, 243, 244, 337, 246, 347, 369, 249, 250, 251, 252, 281, 539, 255],
21
- "koi8-r": [9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 8992, 9632, 8729, 8730, 8776, 8804, 8805, 160, 8993, 176, 178, 183, 247, 9552, 9553, 9554, 1105, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 1025, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 169, 1102, 1072, 1073, 1094, 1076, 1077, 1092, 1075, 1093, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1103, 1088, 1089, 1090, 1091, 1078, 1074, 1100, 1099, 1079, 1096, 1101, 1097, 1095, 1098, 1070, 1040, 1041, 1062, 1044, 1045, 1060, 1043, 1061, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1071, 1056, 1057, 1058, 1059, 1046, 1042, 1068, 1067, 1047, 1064, 1069, 1065, 1063, 1066],
22
- "koi8-u": [9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 8992, 9632, 8729, 8730, 8776, 8804, 8805, 160, 8993, 176, 178, 183, 247, 9552, 9553, 9554, 1105, 1108, 9556, 1110, 1111, 9559, 9560, 9561, 9562, 9563, 1169, 1118, 9566, 9567, 9568, 9569, 1025, 1028, 9571, 1030, 1031, 9574, 9575, 9576, 9577, 9578, 1168, 1038, 169, 1102, 1072, 1073, 1094, 1076, 1077, 1092, 1075, 1093, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1103, 1088, 1089, 1090, 1091, 1078, 1074, 1100, 1099, 1079, 1096, 1101, 1097, 1095, 1098, 1070, 1040, 1041, 1062, 1044, 1045, 1060, 1043, 1061, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1071, 1056, 1057, 1058, 1059, 1046, 1042, 1068, 1067, 1047, 1064, 1069, 1065, 1063, 1066],
23
- "macintosh": [196, 197, 199, 201, 209, 214, 220, 225, 224, 226, 228, 227, 229, 231, 233, 232, 234, 235, 237, 236, 238, 239, 241, 243, 242, 244, 246, 245, 250, 249, 251, 252, 8224, 176, 162, 163, 167, 8226, 182, 223, 174, 169, 8482, 180, 168, 8800, 198, 216, 8734, 177, 8804, 8805, 165, 181, 8706, 8721, 8719, 960, 8747, 170, 186, 937, 230, 248, 191, 161, 172, 8730, 402, 8776, 8710, 171, 187, 8230, 160, 192, 195, 213, 338, 339, 8211, 8212, 8220, 8221, 8216, 8217, 247, 9674, 255, 376, 8260, 8364, 8249, 8250, 64257, 64258, 8225, 183, 8218, 8222, 8240, 194, 202, 193, 203, 200, 205, 206, 207, 204, 211, 212, 63743, 210, 218, 219, 217, 305, 710, 732, 175, 728, 729, 730, 184, 733, 731, 711],
24
- "windows-874": [8364, 129, 130, 131, 132, 8230, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 153, 154, 155, 156, 157, 158, 159, 160, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, null, null, null, null, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, null, null, null, null],
25
- "windows-1250": [8364, 129, 8218, 131, 8222, 8230, 8224, 8225, 136, 8240, 352, 8249, 346, 356, 381, 377, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 353, 8250, 347, 357, 382, 378, 160, 711, 728, 321, 164, 260, 166, 167, 168, 169, 350, 171, 172, 173, 174, 379, 176, 177, 731, 322, 180, 181, 182, 183, 184, 261, 351, 187, 317, 733, 318, 380, 340, 193, 194, 258, 196, 313, 262, 199, 268, 201, 280, 203, 282, 205, 206, 270, 272, 323, 327, 211, 212, 336, 214, 215, 344, 366, 218, 368, 220, 221, 354, 223, 341, 225, 226, 259, 228, 314, 263, 231, 269, 233, 281, 235, 283, 237, 238, 271, 273, 324, 328, 243, 244, 337, 246, 247, 345, 367, 250, 369, 252, 253, 355, 729],
26
- "windows-1251": [1026, 1027, 8218, 1107, 8222, 8230, 8224, 8225, 8364, 8240, 1033, 8249, 1034, 1036, 1035, 1039, 1106, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 1113, 8250, 1114, 1116, 1115, 1119, 160, 1038, 1118, 1032, 164, 1168, 166, 167, 1025, 169, 1028, 171, 172, 173, 174, 1031, 176, 177, 1030, 1110, 1169, 181, 182, 183, 1105, 8470, 1108, 187, 1112, 1029, 1109, 1111, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103],
27
- "windows-1252": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 382, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255],
28
- "windows-1253": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 136, 8240, 138, 8249, 140, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 154, 8250, 156, 157, 158, 159, 160, 901, 902, 163, 164, 165, 166, 167, 168, 169, null, 171, 172, 173, 174, 8213, 176, 177, 178, 179, 900, 181, 182, 183, 904, 905, 906, 187, 908, 189, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, null, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, null],
29
- "windows-1254": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 158, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 286, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 304, 350, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 287, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 305, 351, 255],
30
- "windows-1255": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 138, 8249, 140, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 154, 8250, 156, 157, 158, 159, 160, 161, 162, 163, 8362, 165, 166, 167, 168, 169, 215, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 247, 187, 188, 189, 190, 191, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1520, 1521, 1522, 1523, 1524, null, null, null, null, null, null, null, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, null, null, 8206, 8207, null],
31
- "windows-1256": [8364, 1662, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 1657, 8249, 338, 1670, 1688, 1672, 1711, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 1705, 8482, 1681, 8250, 339, 8204, 8205, 1722, 160, 1548, 162, 163, 164, 165, 166, 167, 168, 169, 1726, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 1563, 187, 188, 189, 190, 1567, 1729, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 215, 1591, 1592, 1593, 1594, 1600, 1601, 1602, 1603, 224, 1604, 226, 1605, 1606, 1607, 1608, 231, 232, 233, 234, 235, 1609, 1610, 238, 239, 1611, 1612, 1613, 1614, 244, 1615, 1616, 247, 1617, 249, 1618, 251, 252, 8206, 8207, 1746],
32
- "windows-1257": [8364, 129, 8218, 131, 8222, 8230, 8224, 8225, 136, 8240, 138, 8249, 140, 168, 711, 184, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 154, 8250, 156, 175, 731, 159, 160, null, 162, 163, 164, null, 166, 167, 216, 169, 342, 171, 172, 173, 174, 198, 176, 177, 178, 179, 180, 181, 182, 183, 248, 185, 343, 187, 188, 189, 190, 230, 260, 302, 256, 262, 196, 197, 280, 274, 268, 201, 377, 278, 290, 310, 298, 315, 352, 323, 325, 211, 332, 213, 214, 215, 370, 321, 346, 362, 220, 379, 381, 223, 261, 303, 257, 263, 228, 229, 281, 275, 269, 233, 378, 279, 291, 311, 299, 316, 353, 324, 326, 243, 333, 245, 246, 247, 371, 322, 347, 363, 252, 380, 382, 729],
33
- "windows-1258": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 138, 8249, 338, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 154, 8250, 339, 157, 158, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 258, 196, 197, 198, 199, 200, 201, 202, 203, 768, 205, 206, 207, 272, 209, 777, 211, 212, 416, 214, 215, 216, 217, 218, 219, 220, 431, 771, 223, 224, 225, 226, 259, 228, 229, 230, 231, 232, 233, 234, 235, 769, 237, 238, 239, 273, 241, 803, 243, 244, 417, 246, 247, 248, 249, 250, 251, 252, 432, 8363, 255],
34
- "x-mac-cyrillic": [1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 8224, 176, 1168, 163, 167, 8226, 182, 1030, 174, 169, 8482, 1026, 1106, 8800, 1027, 1107, 8734, 177, 8804, 8805, 1110, 181, 1169, 1032, 1028, 1108, 1031, 1111, 1033, 1113, 1034, 1114, 1112, 1029, 172, 8730, 402, 8776, 8710, 171, 187, 8230, 160, 1035, 1115, 1036, 1116, 1109, 8211, 8212, 8220, 8221, 8216, 8217, 247, 8222, 1038, 1118, 1039, 1119, 8470, 1025, 1105, 1103, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 8364]
35
- };