Skip to content
Myr

extends.ts

This file

Path

src/extends.ts

24 lines · 585 bytes · TypeScript

Last changed by

feat: general typing improvements for TS 3.7 and upMichel Weststratebefore adoptionf930ce1

History of this file

Take it

feat: general typing improvements for TS 3.7 and upMichel Weststratebefore adoptionf930ce1

line 1why, one step back
1/* istanbul ignore next */

fix: Map and Set instantions won't work on certain environments, fixes #502Michel Weststratebefore adoption9f4711a

lines 2–24why, one step back
2var extendStatics = function(d: any, b: any): any {
3 extendStatics =4 Object.setPrototypeOf ||5 ({__proto__: []} instanceof Array &&6 function(d, b) {7 d.__proto__ = b8 }) ||9 function(d, b) {10 for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]11 }12 return extendStatics(d, b)13}1415// Ugly hack to resolve #502 and inherit built in Map / Set16export function __extends(d: any, b: any): any {17 extendStatics(d, b)18 function __(this: any): any {19 this.constructor = d20 }21 d.prototype =22 // @ts-ignore23 ((__.prototype = b.prototype), new __())24}