index.js 372 B

123456789101112131415
  1. export default function assign(target, dirtyObject) {
  2. if (target == null) {
  3. throw new TypeError('assign requires that input parameter not be null or undefined');
  4. }
  5. dirtyObject = dirtyObject || {};
  6. for (var property in dirtyObject) {
  7. if (dirtyObject.hasOwnProperty(property)) {
  8. target[property] = dirtyObject[property];
  9. }
  10. }
  11. return target;
  12. }