lowcode-engine/packages/utils/set-prototype-of.ts
2020-03-27 14:01:27 +08:00

9 lines
254 B
TypeScript

export function setPrototypeOf(target: any, proto: any) {
// tslint:disable-next-line
if (typeof Object.setPrototypeOf !== 'undefined') {
Object.setPrototypeOf(target, proto); // tslint:disable-line
} else {
target.__proto__ = proto;
}
}