Skip to content

Instantly share code, notes, and snippets.

@bogdanpetru
Last active February 15, 2017 10:26
Show Gist options
  • Save bogdanpetru/e06b3884b7ef55dbfcf5f78763ecb2f9 to your computer and use it in GitHub Desktop.
Save bogdanpetru/e06b3884b7ef55dbfcf5f78763ecb2f9 to your computer and use it in GitHub Desktop.
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function assign() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (typeof Object.assign === 'function') {
return Object.assign.apply(Object, args);
} else {
return args.reduce(acc, function (item, index) {
if (index === 0) {
return item;
}
return _extends({}, acc, item);
});
}
}
exports.default = assign;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment