@loaders.gl/polyfills 3.4.14 → 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
|
@@ -5,118 +5,77 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Headers = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
9
|
+
let _Symbol$iterator;
|
|
13
10
|
_Symbol$iterator = Symbol.iterator;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _this = this;
|
|
17
|
-
(0, _classCallCheck2.default)(this, Headers);
|
|
11
|
+
class Headers {
|
|
12
|
+
constructor(headers) {
|
|
18
13
|
(0, _defineProperty2.default)(this, "map", void 0);
|
|
19
14
|
this.map = {};
|
|
20
15
|
if (headers instanceof Headers) {
|
|
21
|
-
headers.forEach(
|
|
22
|
-
return _this.append(name, value);
|
|
23
|
-
});
|
|
16
|
+
headers.forEach((value, name) => this.append(name, value));
|
|
24
17
|
} else if (Array.isArray(headers)) {
|
|
25
|
-
headers.forEach(
|
|
26
|
-
return _this.append(header[0], header[1]);
|
|
27
|
-
});
|
|
18
|
+
headers.forEach(header => this.append(header[0], header[1]));
|
|
28
19
|
} else if (headers) {
|
|
29
|
-
Object.getOwnPropertyNames(headers).forEach(
|
|
30
|
-
return _this.append(name, headers[name]);
|
|
31
|
-
});
|
|
20
|
+
Object.getOwnPropertyNames(headers).forEach(name => this.append(name, headers[name]));
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
value
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.map[normalizeName(name)] = normalizeValue(value);
|
|
62
|
-
}
|
|
63
|
-
}, {
|
|
64
|
-
key: "forEach",
|
|
65
|
-
value: function forEach(visitor) {
|
|
66
|
-
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
67
|
-
for (var name in this.map) {
|
|
68
|
-
if (this.map.hasOwnProperty(name)) {
|
|
69
|
-
if (thisArg) {
|
|
70
|
-
visitor.call(thisArg, this.map[name], name, this);
|
|
71
|
-
} else {
|
|
72
|
-
visitor(this.map[name], name, this);
|
|
73
|
-
}
|
|
23
|
+
append(name, value) {
|
|
24
|
+
name = normalizeName(name);
|
|
25
|
+
value = normalizeValue(value);
|
|
26
|
+
const oldValue = this.map[name];
|
|
27
|
+
this.map[name] = oldValue ? "".concat(oldValue, ", ").concat(value) : value;
|
|
28
|
+
}
|
|
29
|
+
delete(name) {
|
|
30
|
+
delete this.map[normalizeName(name)];
|
|
31
|
+
}
|
|
32
|
+
get(name) {
|
|
33
|
+
name = normalizeName(name);
|
|
34
|
+
return this.has(name) ? this.map[name] : null;
|
|
35
|
+
}
|
|
36
|
+
has(name) {
|
|
37
|
+
return this.map.hasOwnProperty(normalizeName(name));
|
|
38
|
+
}
|
|
39
|
+
set(name, value) {
|
|
40
|
+
this.map[normalizeName(name)] = normalizeValue(value);
|
|
41
|
+
}
|
|
42
|
+
forEach(visitor) {
|
|
43
|
+
let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
44
|
+
for (const name in this.map) {
|
|
45
|
+
if (this.map.hasOwnProperty(name)) {
|
|
46
|
+
if (thisArg) {
|
|
47
|
+
visitor.call(thisArg, this.map[name], name, this);
|
|
48
|
+
} else {
|
|
49
|
+
visitor(this.map[name], name, this);
|
|
74
50
|
}
|
|
75
51
|
}
|
|
76
52
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: _Symbol$iterator,
|
|
106
|
-
value: _regenerator.default.mark(function value() {
|
|
107
|
-
return _regenerator.default.wrap(function value$(_context) {
|
|
108
|
-
while (1) switch (_context.prev = _context.next) {
|
|
109
|
-
case 0:
|
|
110
|
-
return _context.delegateYield(this.entries(), "t0", 1);
|
|
111
|
-
case 1:
|
|
112
|
-
case "end":
|
|
113
|
-
return _context.stop();
|
|
114
|
-
}
|
|
115
|
-
}, value, this);
|
|
116
|
-
})
|
|
117
|
-
}]);
|
|
118
|
-
return Headers;
|
|
119
|
-
}();
|
|
53
|
+
}
|
|
54
|
+
keys() {
|
|
55
|
+
const items = [];
|
|
56
|
+
this.forEach(function (value, name) {
|
|
57
|
+
items.push(name);
|
|
58
|
+
});
|
|
59
|
+
return iteratorFor(items);
|
|
60
|
+
}
|
|
61
|
+
values() {
|
|
62
|
+
const items = [];
|
|
63
|
+
this.forEach(function (value) {
|
|
64
|
+
items.push(value);
|
|
65
|
+
});
|
|
66
|
+
return iteratorFor(items);
|
|
67
|
+
}
|
|
68
|
+
entries() {
|
|
69
|
+
const items = [];
|
|
70
|
+
this.forEach(function (value, name) {
|
|
71
|
+
items.push([name, value]);
|
|
72
|
+
});
|
|
73
|
+
return iteratorFor(items);
|
|
74
|
+
}
|
|
75
|
+
*[_Symbol$iterator]() {
|
|
76
|
+
yield* this.entries();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
120
79
|
exports.Headers = Headers;
|
|
121
80
|
function normalizeName(name) {
|
|
122
81
|
if (typeof name !== 'string') {
|
|
@@ -134,12 +93,12 @@ function normalizeValue(value) {
|
|
|
134
93
|
return value;
|
|
135
94
|
}
|
|
136
95
|
function iteratorFor(items) {
|
|
137
|
-
|
|
138
|
-
next
|
|
139
|
-
|
|
96
|
+
const iterator = {
|
|
97
|
+
next() {
|
|
98
|
+
const value = items.shift();
|
|
140
99
|
return {
|
|
141
100
|
done: value === undefined,
|
|
142
|
-
value
|
|
101
|
+
value
|
|
143
102
|
};
|
|
144
103
|
}
|
|
145
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.node.js","names":["Symbol","iterator","Headers","
|
|
1
|
+
{"version":3,"file":"headers.node.js","names":["Symbol","iterator","Headers","constructor","headers","_defineProperty2","default","map","forEach","value","name","append","Array","isArray","header","Object","getOwnPropertyNames","normalizeName","normalizeValue","oldValue","concat","delete","get","has","hasOwnProperty","set","visitor","thisArg","arguments","length","undefined","call","keys","items","push","iteratorFor","values","entries","_Symbol$iterator","exports","String","test","TypeError","toLowerCase","next","shift","done"],"sources":["../../../../src/node/fetch/headers.node.ts"],"sourcesContent":["/**\n * Polyfill for Browser Headers\n * Based on https://github.com/github/fetch under MIT license\n */\nexport class Headers {\n map: {};\n\n constructor(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach((value, name) => this.append(name, value));\n } else if (Array.isArray(headers)) {\n headers.forEach((header) => this.append(header[0], header[1]));\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach((name) => this.append(name, headers[name]));\n }\n }\n\n append(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n const oldValue = this.map[name];\n this.map[name] = oldValue ? `${oldValue}, ${value}` : value;\n }\n\n delete(name) {\n delete this.map[normalizeName(name)];\n }\n\n get(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null;\n }\n\n has(name) {\n return this.map.hasOwnProperty(normalizeName(name));\n }\n\n set(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n }\n\n forEach(visitor, thisArg = null) {\n for (const name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n if (thisArg) {\n visitor.call(thisArg, this.map[name], name, this);\n } else {\n visitor(this.map[name], name, this);\n }\n }\n }\n }\n\n keys() {\n const items: any[] = [];\n this.forEach(function (value, name) {\n items.push(name);\n });\n return iteratorFor(items);\n }\n\n values() {\n const items: any[] = [];\n this.forEach(function (value) {\n items.push(value);\n });\n return iteratorFor(items);\n }\n\n entries() {\n const items: any[] = [];\n this.forEach(function (value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items);\n }\n\n *[Symbol.iterator]() {\n // @ts-ignore must have a '[Symbol.iterator]()' method that returns an iterator.\n yield* this.entries();\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name');\n }\n return name.toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value;\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n const iterator = {\n next() {\n const value = items.shift();\n return {done: value === undefined, value};\n }\n };\n\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n\n return iterator;\n}\n"],"mappings":";;;;;;;;;mBA+EIA,MAAM,CAACC,QAAQ;AA3EZ,MAAMC,OAAO,CAAC;EAGnBC,WAAWA,CAACC,OAAO,EAAE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AAOA,QAAQ;AACjB"}
|
|
@@ -5,31 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Response = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
14
9
|
var _assert = require("../../utils/assert");
|
|
15
10
|
var _streamUtils = require("./utils/stream-utils.node");
|
|
16
11
|
var _headers = require("./headers.node");
|
|
17
12
|
var _stream = require("stream");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var isObject = function isObject(x) {
|
|
25
|
-
return x !== null && (0, _typeof2.default)(x) === 'object';
|
|
26
|
-
};
|
|
27
|
-
var isReadableNodeStream = function isReadableNodeStream(x) {
|
|
28
|
-
return isObject(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);
|
|
29
|
-
};
|
|
30
|
-
var Response = function () {
|
|
31
|
-
function Response(body, options) {
|
|
32
|
-
(0, _classCallCheck2.default)(this, Response);
|
|
13
|
+
const isBoolean = x => typeof x === 'boolean';
|
|
14
|
+
const isFunction = x => typeof x === 'function';
|
|
15
|
+
const isObject = x => x !== null && typeof x === 'object';
|
|
16
|
+
const isReadableNodeStream = x => isObject(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);
|
|
17
|
+
class Response {
|
|
18
|
+
constructor(body, options) {
|
|
33
19
|
(0, _defineProperty2.default)(this, "ok", void 0);
|
|
34
20
|
(0, _defineProperty2.default)(this, "status", void 0);
|
|
35
21
|
(0, _defineProperty2.default)(this, "statusText", void 0);
|
|
@@ -37,13 +23,12 @@ var Response = function () {
|
|
|
37
23
|
(0, _defineProperty2.default)(this, "url", void 0);
|
|
38
24
|
(0, _defineProperty2.default)(this, "bodyUsed", false);
|
|
39
25
|
(0, _defineProperty2.default)(this, "_body", void 0);
|
|
40
|
-
|
|
41
|
-
headers
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
url = _ref.url;
|
|
26
|
+
const {
|
|
27
|
+
headers,
|
|
28
|
+
status = 200,
|
|
29
|
+
statusText = 'OK',
|
|
30
|
+
url
|
|
31
|
+
} = options || {};
|
|
47
32
|
this.url = url;
|
|
48
33
|
this.ok = status === 200;
|
|
49
34
|
this.status = status;
|
|
@@ -57,126 +42,34 @@ var Response = function () {
|
|
|
57
42
|
this._body = _stream.Readable.from([body || new ArrayBuffer(0)]);
|
|
58
43
|
}
|
|
59
44
|
}
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
get body() {
|
|
46
|
+
(0, _assert.assert)(!this.bodyUsed);
|
|
47
|
+
(0, _assert.assert)(isReadableNodeStream(this._body));
|
|
48
|
+
this.bodyUsed = true;
|
|
49
|
+
return this._body;
|
|
50
|
+
}
|
|
51
|
+
async arrayBuffer() {
|
|
52
|
+
if (!isReadableNodeStream(this._body)) {
|
|
53
|
+
return this._body || new ArrayBuffer(0);
|
|
54
|
+
}
|
|
55
|
+
const data = await (0, _streamUtils.concatenateReadStream)(this._body);
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
async text() {
|
|
59
|
+
const arrayBuffer = await this.arrayBuffer();
|
|
60
|
+
const textDecoder = new TextDecoder();
|
|
61
|
+
return textDecoder.decode(arrayBuffer);
|
|
62
|
+
}
|
|
63
|
+
async json() {
|
|
64
|
+
const text = await this.text();
|
|
65
|
+
return JSON.parse(text);
|
|
66
|
+
}
|
|
67
|
+
async blob() {
|
|
68
|
+
if (typeof Blob === 'undefined') {
|
|
69
|
+
throw new Error('Blob polyfill not installed');
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var _arrayBuffer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
72
|
-
var data;
|
|
73
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
74
|
-
while (1) switch (_context.prev = _context.next) {
|
|
75
|
-
case 0:
|
|
76
|
-
if (isReadableNodeStream(this._body)) {
|
|
77
|
-
_context.next = 2;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
return _context.abrupt("return", this._body || new ArrayBuffer(0));
|
|
81
|
-
case 2:
|
|
82
|
-
_context.next = 4;
|
|
83
|
-
return (0, _streamUtils.concatenateReadStream)(this._body);
|
|
84
|
-
case 4:
|
|
85
|
-
data = _context.sent;
|
|
86
|
-
return _context.abrupt("return", data);
|
|
87
|
-
case 6:
|
|
88
|
-
case "end":
|
|
89
|
-
return _context.stop();
|
|
90
|
-
}
|
|
91
|
-
}, _callee, this);
|
|
92
|
-
}));
|
|
93
|
-
function arrayBuffer() {
|
|
94
|
-
return _arrayBuffer.apply(this, arguments);
|
|
95
|
-
}
|
|
96
|
-
return arrayBuffer;
|
|
97
|
-
}()
|
|
98
|
-
}, {
|
|
99
|
-
key: "text",
|
|
100
|
-
value: function () {
|
|
101
|
-
var _text = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2() {
|
|
102
|
-
var arrayBuffer, textDecoder;
|
|
103
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
104
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
105
|
-
case 0:
|
|
106
|
-
_context2.next = 2;
|
|
107
|
-
return this.arrayBuffer();
|
|
108
|
-
case 2:
|
|
109
|
-
arrayBuffer = _context2.sent;
|
|
110
|
-
textDecoder = new TextDecoder();
|
|
111
|
-
return _context2.abrupt("return", textDecoder.decode(arrayBuffer));
|
|
112
|
-
case 5:
|
|
113
|
-
case "end":
|
|
114
|
-
return _context2.stop();
|
|
115
|
-
}
|
|
116
|
-
}, _callee2, this);
|
|
117
|
-
}));
|
|
118
|
-
function text() {
|
|
119
|
-
return _text.apply(this, arguments);
|
|
120
|
-
}
|
|
121
|
-
return text;
|
|
122
|
-
}()
|
|
123
|
-
}, {
|
|
124
|
-
key: "json",
|
|
125
|
-
value: function () {
|
|
126
|
-
var _json = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3() {
|
|
127
|
-
var text;
|
|
128
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
129
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
130
|
-
case 0:
|
|
131
|
-
_context3.next = 2;
|
|
132
|
-
return this.text();
|
|
133
|
-
case 2:
|
|
134
|
-
text = _context3.sent;
|
|
135
|
-
return _context3.abrupt("return", JSON.parse(text));
|
|
136
|
-
case 4:
|
|
137
|
-
case "end":
|
|
138
|
-
return _context3.stop();
|
|
139
|
-
}
|
|
140
|
-
}, _callee3, this);
|
|
141
|
-
}));
|
|
142
|
-
function json() {
|
|
143
|
-
return _json.apply(this, arguments);
|
|
144
|
-
}
|
|
145
|
-
return json;
|
|
146
|
-
}()
|
|
147
|
-
}, {
|
|
148
|
-
key: "blob",
|
|
149
|
-
value: function () {
|
|
150
|
-
var _blob = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4() {
|
|
151
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
152
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
153
|
-
case 0:
|
|
154
|
-
if (!(typeof Blob === 'undefined')) {
|
|
155
|
-
_context4.next = 2;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
throw new Error('Blob polyfill not installed');
|
|
159
|
-
case 2:
|
|
160
|
-
_context4.t0 = Blob;
|
|
161
|
-
_context4.next = 5;
|
|
162
|
-
return this.arrayBuffer();
|
|
163
|
-
case 5:
|
|
164
|
-
_context4.t1 = _context4.sent;
|
|
165
|
-
_context4.t2 = [_context4.t1];
|
|
166
|
-
return _context4.abrupt("return", new _context4.t0(_context4.t2));
|
|
167
|
-
case 8:
|
|
168
|
-
case "end":
|
|
169
|
-
return _context4.stop();
|
|
170
|
-
}
|
|
171
|
-
}, _callee4, this);
|
|
172
|
-
}));
|
|
173
|
-
function blob() {
|
|
174
|
-
return _blob.apply(this, arguments);
|
|
175
|
-
}
|
|
176
|
-
return blob;
|
|
177
|
-
}()
|
|
178
|
-
}]);
|
|
179
|
-
return Response;
|
|
180
|
-
}();
|
|
71
|
+
return new Blob([await this.arrayBuffer()]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
181
74
|
exports.Response = Response;
|
|
182
75
|
//# sourceMappingURL=response.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.node.js","names":["_assert","require","_streamUtils","_headers","_stream","isBoolean","x","isFunction","isObject","
|
|
1
|
+
{"version":3,"file":"response.node.js","names":["_assert","require","_streamUtils","_headers","_stream","isBoolean","x","isFunction","isObject","isReadableNodeStream","read","pipe","readable","Response","constructor","body","options","_defineProperty2","default","headers","status","statusText","url","ok","Headers","_body","decompressReadStream","Readable","from","TextEncoder","encode","ArrayBuffer","assert","bodyUsed","arrayBuffer","data","concatenateReadStream","text","textDecoder","TextDecoder","decode","json","JSON","parse","blob","Blob","Error","exports"],"sources":["../../../../src/node/fetch/response.node.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {assert} from '../../utils/assert';\nimport {decompressReadStream, concatenateReadStream} from './utils/stream-utils.node';\nimport {Headers} from './headers.node';\n\nconst isBoolean = (x) => typeof x === 'boolean';\nconst isFunction = (x) => typeof x === 'function';\nconst isObject = (x) => x !== null && typeof x === 'object';\nconst isReadableNodeStream = (x) =>\n isObject(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);\n\n/**\n * Polyfill for Browser Response\n *\n * Under Node.js we return a mock \"fetch response object\"\n * so that apps can use the same API as in the browser.\n *\n * Note: This is intended to be a \"lightweight\" implementation and will have limitations.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/Response\n */\nimport {Readable} from 'stream';\n\nexport class Response {\n readonly ok: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly headers: Headers;\n readonly url: string;\n bodyUsed: boolean = false;\n private readonly _body;\n\n // TODO - handle ArrayBuffer, ArrayBufferView, Buffer\n constructor(\n body,\n options: {\n headers?;\n status?: number;\n statusText?: string;\n url: string;\n }\n ) {\n const {headers, status = 200, statusText = 'OK', url} = options || {};\n\n this.url = url;\n this.ok = status === 200;\n this.status = status; // TODO - handle errors and set status\n this.statusText = statusText;\n this.headers = new Headers(options?.headers || {});\n\n // Check for content-encoding and create a decompression stream\n if (isReadableNodeStream(body)) {\n this._body = decompressReadStream(body, headers);\n } else if (typeof body === 'string') {\n this._body = Readable.from([new TextEncoder().encode(body)]);\n } else {\n this._body = Readable.from([body || new ArrayBuffer(0)]);\n }\n }\n\n // Subset of Properties\n\n // Returns a readable stream to the \"body\" of the response (or file)\n get body() {\n assert(!this.bodyUsed);\n assert(isReadableNodeStream(this._body)); // Not implemented: conversion of ArrayBuffer etc to stream\n this.bodyUsed = true;\n return this._body;\n }\n\n // Subset of Methods\n\n async arrayBuffer() {\n if (!isReadableNodeStream(this._body)) {\n return this._body || new ArrayBuffer(0);\n }\n const data = await concatenateReadStream(this._body);\n return data;\n }\n\n async text() {\n const arrayBuffer = await this.arrayBuffer();\n const textDecoder = new TextDecoder();\n return textDecoder.decode(arrayBuffer);\n }\n\n async json() {\n const text = await this.text();\n return JSON.parse(text);\n }\n\n async blob() {\n if (typeof Blob === 'undefined') {\n throw new Error('Blob polyfill not installed');\n }\n return new Blob([await this.arrayBuffer()]);\n }\n}\n"],"mappings":";;;;;;;;AAEA,IAAAA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,CAAA,EAAG;IACX,MAAMJ,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,CAAC,CAAC;IAC9B,OAAOK,IAAI,CAACC,KAAK,CAACN,IAAI,CAAC;EACzB;EAEA,MAAMO,IAAIA,CAAA,EAAG;IACX,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;MAC/B,MAAM,IAAIC,KAAK,CAAC,6BAA6B,CAAC;IAChD;IACA,OAAO,IAAID,IAAI,CAAC,CAAC,MAAM,IAAI,CAACX,WAAW,CAAC,CAAC,CAAC,CAAC;EAC7C;AACF;AAACa,OAAA,CAAAlC,QAAA,GAAAA,QAAA"}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.decodeDataUri = decodeDataUri;
|
|
8
7
|
exports.toArrayBuffer = toArrayBuffer;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return x && x instanceof ArrayBuffer;
|
|
12
|
-
};
|
|
13
|
-
var isBuffer = function isBuffer(x) {
|
|
14
|
-
return x && x instanceof Buffer;
|
|
15
|
-
};
|
|
8
|
+
const isArrayBuffer = x => x && x instanceof ArrayBuffer;
|
|
9
|
+
const isBuffer = x => x && x instanceof Buffer;
|
|
16
10
|
function decodeDataUri(uri) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const dataIndex = uri.indexOf(',');
|
|
12
|
+
let buffer;
|
|
13
|
+
let mimeType;
|
|
20
14
|
if (uri.slice(dataIndex - 7, dataIndex) === ';base64') {
|
|
21
15
|
buffer = Buffer.from(uri.slice(dataIndex + 1), 'base64');
|
|
22
16
|
mimeType = uri.slice(5, dataIndex - 7).trim();
|
|
@@ -31,7 +25,7 @@ function decodeDataUri(uri) {
|
|
|
31
25
|
}
|
|
32
26
|
return {
|
|
33
27
|
arrayBuffer: toArrayBuffer(buffer),
|
|
34
|
-
mimeType
|
|
28
|
+
mimeType
|
|
35
29
|
};
|
|
36
30
|
}
|
|
37
31
|
function toArrayBuffer(data) {
|
|
@@ -39,18 +33,18 @@ function toArrayBuffer(data) {
|
|
|
39
33
|
return data;
|
|
40
34
|
}
|
|
41
35
|
if (isBuffer(data)) {
|
|
42
|
-
|
|
36
|
+
const typedArray = new Uint8Array(data);
|
|
43
37
|
return typedArray.buffer;
|
|
44
38
|
}
|
|
45
39
|
if (ArrayBuffer.isView(data)) {
|
|
46
40
|
return data.buffer;
|
|
47
41
|
}
|
|
48
42
|
if (typeof data === 'string') {
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const text = data;
|
|
44
|
+
const uint8Array = new TextEncoder().encode(text);
|
|
51
45
|
return uint8Array.buffer;
|
|
52
46
|
}
|
|
53
|
-
if (data &&
|
|
47
|
+
if (data && typeof data === 'object' && data._toArrayBuffer) {
|
|
54
48
|
return data._toArrayBuffer();
|
|
55
49
|
}
|
|
56
50
|
throw new Error("toArrayBuffer(".concat(JSON.stringify(data, null, 2).slice(10), ")"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decode-data-uri.node.js","names":["isArrayBuffer","x","ArrayBuffer","isBuffer","Buffer","decodeDataUri","uri","dataIndex","indexOf","buffer","mimeType","slice","from","trim","decodeURIComponent","startsWith","concat","arrayBuffer","toArrayBuffer","data","typedArray","Uint8Array","isView","text","uint8Array","TextEncoder","encode","
|
|
1
|
+
{"version":3,"file":"decode-data-uri.node.js","names":["isArrayBuffer","x","ArrayBuffer","isBuffer","Buffer","decodeDataUri","uri","dataIndex","indexOf","buffer","mimeType","slice","from","trim","decodeURIComponent","startsWith","concat","arrayBuffer","toArrayBuffer","data","typedArray","Uint8Array","isView","text","uint8Array","TextEncoder","encode","_toArrayBuffer","Error","JSON","stringify"],"sources":["../../../../../src/node/fetch/utils/decode-data-uri.node.ts"],"sourcesContent":["// Based on binary-gltf-utils under MIT license: Copyright (c) 2016-17 Karl Cheng\n\nconst isArrayBuffer = (x) => x && x instanceof ArrayBuffer;\nconst isBuffer = (x) => x && x instanceof Buffer;\n\n/**\n * Parses a data URI into a buffer, as well as retrieving its declared MIME type.\n *\n * @param {string} uri - a data URI (assumed to be valid)\n * @returns {Object} { buffer, mimeType }\n */\nexport function decodeDataUri(uri: string): {arrayBuffer: ArrayBuffer; mimeType: string} {\n const dataIndex = uri.indexOf(',');\n\n let buffer;\n let mimeType;\n if (uri.slice(dataIndex - 7, dataIndex) === ';base64') {\n buffer = Buffer.from(uri.slice(dataIndex + 1), 'base64');\n mimeType = uri.slice(5, dataIndex - 7).trim();\n } else {\n buffer = Buffer.from(decodeURIComponent(uri.slice(dataIndex + 1)));\n mimeType = uri.slice(5, dataIndex).trim();\n }\n\n if (!mimeType) {\n mimeType = 'text/plain;charset=US-ASCII';\n } else if (mimeType.startsWith(';')) {\n mimeType = `text/plain${mimeType}`;\n }\n\n return {arrayBuffer: toArrayBuffer(buffer), mimeType};\n}\n\n/**\n * @param data\n * @todo Duplicate of core\n */\nexport function toArrayBuffer(data: unknown): ArrayBuffer {\n if (isArrayBuffer(data)) {\n return data as ArrayBuffer;\n }\n\n // TODO - per docs we should just be able to call buffer.buffer, but there are issues\n if (isBuffer(data)) {\n // @ts-expect-error\n const typedArray = new Uint8Array(data);\n return typedArray.buffer;\n }\n\n // Careful - Node Buffers will look like ArrayBuffers (keep after isBuffer)\n if (ArrayBuffer.isView(data)) {\n return data.buffer;\n }\n\n if (typeof data === 'string') {\n const text = data;\n const uint8Array = new TextEncoder().encode(text);\n return uint8Array.buffer;\n }\n\n // HACK to support Blob polyfill\n // @ts-expect-error\n if (data && typeof data === 'object' && data._toArrayBuffer) {\n // @ts-expect-error\n return data._toArrayBuffer();\n }\n\n throw new Error(`toArrayBuffer(${JSON.stringify(data, null, 2).slice(10)})`);\n}\n"],"mappings":";;;;;;;AAEA,MAAMA,aAAa,GA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