How to use the object-assign.call function in object-assign

To help you get started, we’ve selected a few object-assign examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Qiuyaxian / lm-ui / lm-react / src / core / utils / tools.tsx View on Github external
export function extend() {
  let args = toArray(arguments),
    arg = args.shift();
  if (objectAssign) {
    return objectAssign.call(null, arg, ...args);
  } else {
    if (Object.assign) {
      for (let i = 0; i < args.length; i++) {
        arg = Object.assign(arg, args[i]);
      }
      return arg;
    } else {
      for (let i = 0; i < args.length; i++) {
        prop(args[i], function (p) {
          arg[p] = args[i][p];
        });
      }
      return arg;
    }
  }
}
github Qiuyaxian / lm-ui / lm-vue / src / utils / tools.js View on Github external
export function extend () { 
  let args = toArray(arguments),
      arg = args.shift();
  if (objectAssign) { 
    return objectAssign.call(null, arg, ...args);
  } else { 
    if (Object.assign) { 
      for (let i = 0; i < args.length; i++ ) {
        arg = Object.assign(arg, args[i]);
      }
      return arg; 
    } else {
      for (let i = 0; i < args.length; i++ ) { 
        prop (args[i], function (p) {
          arg[p] = args[i][p];
        });
      } 
      return arg;
    }
  }  
}
github Qiuyaxian / lm-ui / lm-angular / src / core / utils / tools.ts View on Github external
export function extend (...argument: any[]): any { 
  let args = toArray(arguments),
      arg = args.shift();
  if (objectAssign) { 
    return objectAssign.call(null, arg, ...args);
  } else { 
    if (Object.assign) { 
      for (let i = 0; i < args.length; i++ ) {
        arg = Object.assign(arg, args[i]);
      }
      return arg; 
    } else {
      for (let i = 0; i < args.length; i++ ) { 
        prop (args[i], function (p) {
          arg[p] = args[i][p];
        });
      } 
      return arg;
    }
  }  
}

object-assign

ES2015 `Object.assign()` ponyfill

MIT
Latest version published 8 years ago

Package Health Score

77 / 100
Full package analysis