@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,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var moduleExports = require('./index');
3
+ const moduleExports = require('./index');
4
4
  globalThis.loaders = globalThis.loaders || {};
5
5
  module.exports = Object.assign(globalThis.loaders, moduleExports);
6
6
  //# sourceMappingURL=bundle.js.map
@@ -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,IAAMA,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"}
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 get() {
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 get() {
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 get() {
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 get() {
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 get() {
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 get() {
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 get() {
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 _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
66
- 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; }
67
- var installTextEncoder = !_globals.isBrowser || !('TextEncoder' in _globals.global);
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
- var installTextDecoder = !_globals.isBrowser || !('TextDecoder' in _globals.global);
70
+ const installTextDecoder = !_globals.isBrowser || !('TextDecoder' in _globals.global);
72
71
  if (installTextDecoder) {
73
72
  _globals.global['TextDecoder'] = _encoding.TextDecoder;
74
73
  }
@@ -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","_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","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 (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C,IAAIM,gBAAW,EAAE;EACvDN,eAAM,CAAC,SAAS,CAAC,GAAGM,gBAAW;AACjC;AAEA,IAAI,CAACP,kBAAS,IAAI,EAAE,UAAU,IAAIC,eAAM,CAAC,IAAIO,kBAAY,EAAE;EACzDP,eAAM,CAAC,UAAU,CAAC,GAAGO,kBAAY;AACnC;AAEA,IAAI,CAACR,kBAAS,IAAI,EAAE,OAAO,IAAIC,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"}
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,OAAA;AAGA,IAAAI,MAAA,GAAAC,uBAAA,CAAAL,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAEA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAEA,IAAAW,eAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,KAAA,GAAAd,OAAA;AACA,IAAAe,qBAAA,GAAAf,OAAA;AAEA,IAAAgB,UAAA,GAAAhB,OAAA;AAA6E,SAAAiB,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M,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"}
@@ -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 endOfStream() {
76
+ endOfStream: function () {
78
77
  return !this.tokens.length;
79
78
  },
80
- read: function read() {
79
+ read: function () {
81
80
  if (!this.tokens.length) return end_of_stream;
82
81
  return this.tokens.pop();
83
82
  },
84
- prepend: function prepend(token) {
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 push(token) {
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 handler(stream, bite) {}
110
+ handler: function (stream, bite) {}
112
111
  };
113
112
  function Encoder() {}
114
113
  Encoder.prototype = {
115
- handler: function handler(stream, code_point) {}
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 get() {
372
+ get: function () {
374
373
  return this._encoding.name.toLowerCase();
375
374
  }
376
375
  });
377
376
  Object.defineProperty(TextDecoder.prototype, 'fatal', {
378
- get: function get() {
377
+ get: function () {
379
378
  return this._error_mode === 'fatal';
380
379
  }
381
380
  });
382
381
  Object.defineProperty(TextDecoder.prototype, 'ignoreBOM', {
383
- get: function get() {
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 ((0, _typeof2.default)(input) === 'object' && input instanceof ArrayBuffer) {
389
+ if (typeof input === 'object' && input instanceof ArrayBuffer) {
391
390
  bytes = new Uint8Array(input);
392
- } else if ((0, _typeof2.default)(input) === 'object' && 'buffer' in input && input.buffer instanceof ArrayBuffer) {
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 get() {
465
+ get: function () {
467
466
  return this._encoding.name.toLowerCase();
468
467
  }
469
468
  });