UNPKG

873 BJavaScriptView Raw
1Object.defineProperty(exports, "__esModule", { value: true });
2exports.setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties);
3/**
4 * setPrototypeOf polyfill using __proto__
5 */
6// eslint-disable-next-line @typescript-eslint/ban-types
7function setProtoOf(obj, proto) {
8 // @ts-ignore __proto__ does not exist on obj
9 obj.__proto__ = proto;
10 return obj;
11}
12/**
13 * setPrototypeOf polyfill using mixin
14 */
15// eslint-disable-next-line @typescript-eslint/ban-types
16function mixinProperties(obj, proto) {
17 for (var prop in proto) {
18 // eslint-disable-next-line no-prototype-builtins
19 if (!obj.hasOwnProperty(prop)) {
20 // @ts-ignore typescript complains about indexing so we remove
21 obj[prop] = proto[prop];
22 }
23 }
24 return obj;
25}
26//# sourceMappingURL=polyfill.js.map
\No newline at end of file