swc/packages/swc-helpers/esm/_object_spread.js

24 lines
733 B
JavaScript
Raw Normal View History

import { _define_property } from "./_define_property.js";
export function _object_spread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_define_property(target, key, source[key]);
});
2021-12-05 09:46:09 +03:00
}
return target;
}
export { _object_spread as _ };