Utils.js 381 B

12345678910111213141516171819
  1. /*
  2. Global vars
  3. */
  4. 'use strict';
  5. var extend = function(){
  6. if(arguments.length === 1) return arguments[0];
  7. var source = Array.prototype.splice.call(arguments, 1, 1)[0];
  8. arguments[0] = Object.keys(source).reduce(function(carry, key){
  9. carry[key] = source[key];
  10. return carry;
  11. }, arguments[0]);
  12. return extend.apply(null, arguments);
  13. };
  14. module.exports = {
  15. extend: extend
  16. };