123456789101112131415161718192021222324252627282930313233343536373839 |
- 'use strict';
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
- function ToObject(val) {
- if (val == null) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
- return Object(val);
- }
- function ownEnumerableKeys(obj) {
- var keys = Object.getOwnPropertyNames(obj);
- if (Object.getOwnPropertySymbols) {
- keys = keys.concat(Object.getOwnPropertySymbols(obj));
- }
- return keys.filter(function (key) {
- return propIsEnumerable.call(obj, key);
- });
- }
- module.exports = Object.assign || function (target, source) {
- var from;
- var keys;
- var to = ToObject(target);
- for (var s = 1; s < arguments.length; s++) {
- from = arguments[s];
- keys = ownEnumerableKeys(Object(from));
- for (var i = 0; i < keys.length; i++) {
- to[keys[i]] = from[keys[i]];
- }
- }
- return to;
- };
|