UNPKG

date-fns

Version:

Modern JavaScript date utility library

15 lines (12 loc) 395 B
export default function assign(target, dirtyObject) { if (target == null) { throw new TypeError('assign requires that input parameter not be null or undefined'); } dirtyObject = dirtyObject || {}; for (var property in dirtyObject) { if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) { target[property] = dirtyObject[property]; } } return target; }