Add Web Streams polyfill
This commit is contained in:
parent
802e1b8d94
commit
8658816b90
|
@ -83,7 +83,8 @@
|
||||||
"node-fetch": "^2.1.2",
|
"node-fetch": "^2.1.2",
|
||||||
"node-localstorage": "~1.3.0",
|
"node-localstorage": "~1.3.0",
|
||||||
"pako": "^1.0.6",
|
"pako": "^1.0.6",
|
||||||
"rusha": "^0.8.12"
|
"rusha": "^0.8.12",
|
||||||
|
"web-streams-polyfill": "^1.3.2"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import util from './util';
|
import util from './util';
|
||||||
|
|
||||||
|
if (typeof ReadableStream === 'undefined') {
|
||||||
|
Object.assign(typeof window !== 'undefined' ? window : global, require('web-streams-polyfill'));
|
||||||
|
}
|
||||||
|
|
||||||
function concat(arrays) {
|
function concat(arrays) {
|
||||||
const readers = arrays.map(getReader);
|
const readers = arrays.map(getReader);
|
||||||
let current = 0;
|
let current = 0;
|
||||||
|
|
|
@ -5,6 +5,9 @@ if (typeof Symbol === 'undefined') {
|
||||||
if (typeof Promise === 'undefined') {
|
if (typeof Promise === 'undefined') {
|
||||||
require('core-js/fn/promise');
|
require('core-js/fn/promise');
|
||||||
}
|
}
|
||||||
|
if (typeof ReadableStream === 'undefined') {
|
||||||
|
Object.assign(typeof window !== 'undefined' ? window : global, require('web-streams-polyfill'));
|
||||||
|
}
|
||||||
|
|
||||||
(typeof window !== 'undefined' ? window : global).resolves = function(val) {
|
(typeof window !== 'undefined' ? window : global).resolves = function(val) {
|
||||||
return new Promise(function(res) { res(val); });
|
return new Promise(function(res) { res(val); });
|
||||||
|
|
Loading…
Reference in New Issue
Block a user