UNPKG

612 BJavaScriptView Raw
1import defineProperty from "./defineProperty.js";
2export default function _objectSpread(target) {
3 for (var i = 1; i < arguments.length; i++) {
4 var source = arguments[i] != null ? Object(arguments[i]) : {};
5 var ownKeys = Object.keys(source);
6
7 if (typeof Object.getOwnPropertySymbols === 'function') {
8 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
9 return Object.getOwnPropertyDescriptor(source, sym).enumerable;
10 }));
11 }
12
13 ownKeys.forEach(function (key) {
14 defineProperty(target, key, source[key]);
15 });
16 }
17
18 return target;
19}
\No newline at end of file