mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 10:41:20 -08:00
add srt
This commit is contained in:
1 parent
1d1bf15f0d
commit
8b6258c4e5
11 files changed
+331
-169
No files matched your search
+203
-109
@@ -179,6 +179,90 @@
|
||||
|
||||
var inherits = _inherits;
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
var defineProperty = _defineProperty;
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
var objectSpread = _objectSpread;
|
||||
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
var arrayWithHoles = _arrayWithHoles;
|
||||
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
|
||||
try {
|
||||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
||||
_arr.push(_s.value);
|
||||
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i["return"] != null) _i["return"]();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
|
||||
return _arr;
|
||||
}
|
||||
|
||||
var iterableToArrayLimit = _iterableToArrayLimit;
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
|
||||
var nonIterableRest = _nonIterableRest;
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
|
||||
}
|
||||
|
||||
var slicedToArray = _slicedToArray;
|
||||
|
||||
function _isNativeFunction(fn) {
|
||||
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||||
}
|
||||
@@ -247,7 +331,9 @@
|
||||
}(wrapNativeSuper(Error));
|
||||
|
||||
function errorHandle(condition, msg) {
|
||||
if (!condition) {
|
||||
var isFun = typeof condition === 'function';
|
||||
|
||||
if (isFun ? !isFun() : !condition) {
|
||||
throw new ArtPlayerError(msg);
|
||||
}
|
||||
}
|
||||
@@ -290,6 +376,45 @@
|
||||
var sec = Math.floor(second - hour * 3600 - min * 60);
|
||||
return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':');
|
||||
}
|
||||
function deepMerge() {
|
||||
var isObject = function isObject(value) {
|
||||
return value !== null && _typeof_1(value) === 'object';
|
||||
};
|
||||
|
||||
var returnValue = {};
|
||||
|
||||
for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
sources[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
for (var _i = 0; _i < sources.length; _i++) {
|
||||
var source = sources[_i];
|
||||
|
||||
if (Array.isArray(source)) {
|
||||
if (!Array.isArray(returnValue)) {
|
||||
returnValue = [];
|
||||
}
|
||||
|
||||
returnValue = toConsumableArray(returnValue).concat(toConsumableArray(source));
|
||||
} else if (isObject(source)) {
|
||||
var _arr = Object.entries(source);
|
||||
|
||||
for (var _i2 = 0; _i2 < _arr.length; _i2++) {
|
||||
var _arr$_i = slicedToArray(_arr[_i2], 2),
|
||||
key = _arr$_i[0],
|
||||
value = _arr$_i[1];
|
||||
|
||||
if (isObject(value) && Reflect.has(returnValue, key)) {
|
||||
value = deepMerge(returnValue[key], value);
|
||||
}
|
||||
|
||||
returnValue = objectSpread({}, returnValue, defineProperty({}, key, value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
function validOption(option) {
|
||||
errorHandle(option.container, '\'container\' option is required.');
|
||||
@@ -961,13 +1086,16 @@
|
||||
url = _this$art$option$thum.url,
|
||||
height = _this$art$option$thum.height,
|
||||
width = _this$art$option$thum.width,
|
||||
number = _this$art$option$thum.number;
|
||||
number = _this$art$option$thum.number,
|
||||
column = _this$art$option$thum.column;
|
||||
var perWidth = $progress.clientWidth / number;
|
||||
var index = Math.ceil(posWidth / perWidth);
|
||||
var perIndex = Math.ceil(posWidth / perWidth);
|
||||
var yIndex = Math.ceil(perIndex / column);
|
||||
var xIndex = perIndex % column || column;
|
||||
this.option.ref.style.backgroundImage = "url(".concat(url, ")");
|
||||
this.option.ref.style.height = "".concat(height, "px");
|
||||
this.option.ref.style.width = "".concat(width, "px");
|
||||
this.option.ref.style.backgroundPosition = "-".concat(index * width, "px 0");
|
||||
this.option.ref.style.backgroundPosition = "-".concat(--xIndex * width, "px -").concat(--yIndex * height, "px");
|
||||
|
||||
if (posWidth <= width / 2) {
|
||||
this.option.ref.style.left = 0;
|
||||
@@ -1357,52 +1485,6 @@
|
||||
return Info;
|
||||
}();
|
||||
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
var arrayWithHoles = _arrayWithHoles;
|
||||
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
|
||||
try {
|
||||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
||||
_arr.push(_s.value);
|
||||
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i["return"] != null) _i["return"]();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
|
||||
return _arr;
|
||||
}
|
||||
|
||||
var iterableToArrayLimit = _iterableToArrayLimit;
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
|
||||
var nonIterableRest = _nonIterableRest;
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
|
||||
}
|
||||
|
||||
var slicedToArray = _slicedToArray;
|
||||
|
||||
var Subtitle$1 =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
@@ -1410,11 +1492,8 @@
|
||||
classCallCheck(this, Subtitle);
|
||||
|
||||
this.art = art;
|
||||
|
||||
if (this.art.option.subtitle) {
|
||||
errorHandle(getExt(this.art.option.subtitle.url) === 'vtt', "'url' option require 'vtt' format, but got '".concat(getExt(this.art.option.subtitle.url), "'."));
|
||||
this.init();
|
||||
}
|
||||
this.checkExt(this.art.option.subtitle.url);
|
||||
this.init();
|
||||
}
|
||||
|
||||
createClass(Subtitle, [{
|
||||
@@ -1432,31 +1511,66 @@
|
||||
var $track = document.createElement('track');
|
||||
$track.default = true;
|
||||
$track.kind = 'metadata';
|
||||
$track.src = subtitle.url;
|
||||
$video.appendChild($track);
|
||||
this.art.refs.$track = $track;
|
||||
this.load(subtitle.url).then(function (data) {
|
||||
$track.src = data;
|
||||
$video.appendChild($track);
|
||||
_this.art.refs.$track = $track;
|
||||
|
||||
if ($video.textTracks && $video.textTracks[0]) {
|
||||
var _$video$textTracks = slicedToArray($video.textTracks, 1),
|
||||
track = _$video$textTracks[0];
|
||||
if ($video.textTracks && $video.textTracks[0]) {
|
||||
var _$video$textTracks = slicedToArray($video.textTracks, 1),
|
||||
track = _$video$textTracks[0];
|
||||
|
||||
proxy(track, 'cuechange', function () {
|
||||
var _track$activeCues = slicedToArray(track.activeCues, 1),
|
||||
cue = _track$activeCues[0];
|
||||
proxy(track, 'cuechange', function () {
|
||||
var _track$activeCues = slicedToArray(track.activeCues, 1),
|
||||
cue = _track$activeCues[0];
|
||||
|
||||
$subtitle.innerHTML = '';
|
||||
$subtitle.innerHTML = '';
|
||||
|
||||
if (cue) {
|
||||
var template = document.createElement('div');
|
||||
template.appendChild(cue.getCueAsHTML());
|
||||
$subtitle.innerHTML = template.innerHTML.split(/\r?\n/).map(function (item) {
|
||||
return "<p>".concat(item, "</p>");
|
||||
}).join('');
|
||||
}
|
||||
if (cue) {
|
||||
var template = document.createElement('div');
|
||||
template.appendChild(cue.getCueAsHTML());
|
||||
$subtitle.innerHTML = template.innerHTML.split(/\r?\n/).map(function (item) {
|
||||
return "<p>".concat(item, "</p>");
|
||||
}).join('');
|
||||
}
|
||||
|
||||
_this.art.emit('subtitle:update', $subtitle);
|
||||
});
|
||||
}
|
||||
_this.art.emit('subtitle:update', $subtitle);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "load",
|
||||
value: function load(url) {
|
||||
var _this2 = this;
|
||||
|
||||
var type;
|
||||
return fetch(url).then(function (response) {
|
||||
type = response.headers.get('Content-Type');
|
||||
return response.text();
|
||||
}).then(function (text) {
|
||||
if (/x-subrip/gi.test(type)) {
|
||||
return _this2.srtToVtt(text);
|
||||
}
|
||||
|
||||
return url;
|
||||
}).catch(function (err) {
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "srtToVtt",
|
||||
value: function srtToVtt(text) {
|
||||
var vttText = 'WEBVTT \r\n\r\n'.concat(text.replace(/\{\\([ibu])\}/g, '</$1>').replace(/\{\\([ibu])1\}/g, '<$1>').replace(/\{([ibu])\}/g, '<$1>').replace(/\{\/([ibu])\}/g, '</$1>').replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g, '$1.$2').concat('\r\n\r\n'));
|
||||
return URL.createObjectURL(new Blob([vttText], {
|
||||
type: 'text/vtt'
|
||||
}));
|
||||
}
|
||||
}, {
|
||||
key: "checkExt",
|
||||
value: function checkExt(url) {
|
||||
var ext = getExt(url);
|
||||
errorHandle(ext === 'vtt' || ext === 'srt', "'url' option require 'vtt' or 'srt' format, but got '".concat(ext, "'."));
|
||||
}
|
||||
}, {
|
||||
key: "show",
|
||||
@@ -1475,11 +1589,18 @@
|
||||
}, {
|
||||
key: "switch",
|
||||
value: function _switch(url) {
|
||||
var _this3 = this;
|
||||
|
||||
var $track = this.art.refs.$track;
|
||||
errorHandle(getExt(url) === 'vtt', "'url' option require 'vtt' format, but got '".concat(getExt(url), "'."));
|
||||
this.checkExt(url);
|
||||
errorHandle($track, 'You need to initialize the subtitle option first.');
|
||||
$track.src = url;
|
||||
this.art.emit('subtitle:switch', url);
|
||||
this.load(url).then(function (data) {
|
||||
if (url !== data) {
|
||||
$track.src = data;
|
||||
|
||||
_this3.art.emit('subtitle:switch', url);
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
@@ -1812,25 +1933,6 @@
|
||||
return Mask;
|
||||
}();
|
||||
|
||||
var Srt = function Srt(art) {
|
||||
classCallCheck(this, Srt);
|
||||
|
||||
this.art = art;
|
||||
console.log(this);
|
||||
};
|
||||
|
||||
var Mse = function Mse(art) {
|
||||
classCallCheck(this, Mse);
|
||||
|
||||
this.art = art;
|
||||
console.log(this);
|
||||
};
|
||||
|
||||
var plugins = {
|
||||
Srt: Srt,
|
||||
Mse: Mse
|
||||
};
|
||||
|
||||
var id$2 = 0;
|
||||
var instances = [];
|
||||
|
||||
@@ -1848,13 +1950,11 @@
|
||||
|
||||
_this.emit('init:start');
|
||||
|
||||
_this.option = Object.assign({}, Artplayer.DEFAULTS, option);
|
||||
_this.option = deepMerge({}, Artplayer.DEFAULTS, option);
|
||||
validOption(_this.option);
|
||||
|
||||
_this.init();
|
||||
|
||||
_this.usePlugins();
|
||||
|
||||
_this.emit('init:end');
|
||||
|
||||
return _this;
|
||||
@@ -1892,13 +1992,6 @@
|
||||
instances.push(this);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "usePlugins",
|
||||
value: function usePlugins() {
|
||||
Object.keys(plugins).forEach(function (name) {
|
||||
Artplayer.use(plugins[name]);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "destroy",
|
||||
value: function destroy() {
|
||||
@@ -1946,9 +2039,10 @@
|
||||
poster: '',
|
||||
thumbnails: {
|
||||
url: '',
|
||||
number: 100,
|
||||
number: 60,
|
||||
width: 160,
|
||||
height: 90
|
||||
height: 90,
|
||||
column: 10
|
||||
},
|
||||
volume: 0.7,
|
||||
autoplay: false,
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../src/utils/ArtPlayerError.js","../../src/utils/index.js","../../src/verification/player.js","../../src/config/mimeCodec.js","../../src/config/mse.js","../../src/config/video.js","../../src/config/index.js","../../node_modules/tiny-emitter/index.js","../../src/template.js","../../src/i18n.js","../../src/player.js","../../src/verification/control.js","../../src/controls/danmu.js","../../src/controls/fullscreen.js","../../src/controls/pip.js","../../src/controls/playAndPause.js","../../src/controls/progress.js","../../src/controls/subtitle.js","../../src/controls/time.js","../../src/controls/volume.js","../../src/controls/setting.js","../../src/controls/thumbnails.js","../../src/controls/index.js","../../src/contextmenu.js","../../src/danmu.js","../../src/info.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../src/subtitle.js","../../src/events.js","../../src/hotkey.js","../../src/layers.js","../../src/icons/index.js","../../src/loading.js","../../src/notice.js","../../src/mask.js","../../src/plugins/srt.js","../../src/plugins/mse.js","../../src/plugins/index.js","../../src/index.js"],"sourcesContent":["function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nmodule.exports = _arrayWithoutHoles;","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineLine truncated
|
||||
{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/objectSpread.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../src/utils/ArtPlayerError.js","../../src/utils/index.js","../../src/verification/player.js","../../src/config/mimeCodec.js","../../src/config/mse.js","../../src/config/video.js","../../src/config/index.js","../../node_modules/tiny-emitter/index.js","../../src/template.js","../../src/i18n.js","../../src/player.js","../../src/verification/control.js","../../src/controls/danmu.js","../../src/controls/fullscreen.js","../../src/controls/pip.js","../../src/controls/playAndPause.js","../../src/controls/progress.js","../../src/controls/subtitle.js","../../src/controls/time.js","../../src/controls/volume.js","../../src/controls/setting.js","../../src/controls/thumbnails.js","../../src/controls/index.js","../../src/contextmenu.js","../../src/danmu.js","../../src/info.js","../../src/subtitle.js","../../src/events.js","../../src/hotkey.js","../../src/layers.js","../../src/icons/index.js","../../src/loading.js","../../src/notice.js","../../src/mask.js","../../src/index.js"],"sourcesContent":["function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nmodule.exports = _arrayWithoutHoles;","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descripLine truncated
|
||||
Reference in new issue
Block a user