UNPKG

xl-infinite-tree

Version:

A browser-ready tree library that can efficiently display a large amount of data using infinite scrolling.

22 lines (19 loc) 653 B
/* eslint no-restricted-syntax: 0 */ const extend = (target, ...sources) => { if (target === undefined || target === null) { throw new TypeError('Cannot convert undefined or null to object'); } const output = Object(target); for (let index = 0; index < sources.length; index++) { const source = sources[index]; if (source !== undefined && source !== null) { for (let key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { output[key] = source[key]; } } } } return output; }; module.exports = extend;