export function extendObject(dest: any, ...sources: any[]): any { if (dest == null) { throw TypeError('Cannot convert undefined or null to object'); } for (const source of sources) { if (source) { sourceHasOwnProperty(dest, source); } } return dest; } function sourceHasOwnProperty(dest, source): any { for (const key in source) { if (source.hasOwnProperty(key)) { dest[key] = source[key]; } } }