rx-player
Version:
Canal+ HTML5 Video Player
76 lines (75 loc) • 2.8 kB
JavaScript
;
/**
* Copyright 2015 CANAL+ Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Very simple implementation of Object.assign.
* Should be sufficient for all use-cases here.
*
* Does not support symbols, but this should not be a problem as browsers
* supporting symbols generally support Object.assign;
*
* @param {Object} target
* @param {Array.<Object>} ...sources
* @returns {Object}
*/
function objectAssign(target) {
var e_1, _a;
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
if (target === null || target === undefined) {
throw new TypeError("Cannot convert undefined or null to object");
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
var to = Object(target);
try {
for (var sources_1 = __values(sources), sources_1_1 = sources_1.next(); !sources_1_1.done; sources_1_1 = sources_1.next()) {
var source = sources_1_1.value;
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
to[key] = source[key];
}
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
}
finally { if (e_1) throw e_1.error; }
}
return to;
}
// eslint-disable-next-line no-restricted-properties
exports.default = typeof Object.assign === "function"
? // eslint-disable-next-line no-restricted-properties
Object.assign
: objectAssign;