mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 11:11:30 +03:00
a13a78e3fe
**BREAKING CHANGE:** Breaking changes for `@swc/helpers`. A new major version `0.5.0` is required. **Related issue:** - Closes https://github.com/swc-project/swc/issues/7157
24 lines
733 B
JavaScript
24 lines
733 B
JavaScript
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]);
|
|
});
|
|
}
|
|
|
|
return target;
|
|
}
|
|
export { _object_spread as _ };
|