UNPKG

@sqb/connect

Version:

Multi-dialect database connection framework written with TypeScript

14 lines (13 loc) 511 B
export function applyMixins(derivedCtor, baseCtor, filter) { for (const name of Object.getOwnPropertyNames(baseCtor.prototype)) { if (name === 'constructor' || name === '__proto__' || name === 'toJSON' || name === 'toString' || (filter && !filter(name))) { continue; } Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null)); } }