With latest transform-object-rest-spread 6.19.0 and without transform-es2015-destructuring, transform-es2015-parameters, such code:
function fn({a = 1, ...b} = {}) {
return {a, b};
}
remains the same after transformation
function fn({a = 1, ...b} = {}) {
return {a, b};
}
Without default object = {} it is transformed as expected to
function fn(_ref) {
let { a = 1 } = _ref;
let b = (0, _objectWithoutProperties3.default)(_ref, ["a"]);
return { a, b };
}
}
Babel Configuration (.babelrc)
{
plugins: [
['transform-object-rest-spread', {useBuiltIns: true}]
]
}
With latest
transform-object-rest-spread6.19.0and withouttransform-es2015-destructuring,transform-es2015-parameters, such code:remains the same after transformation
Without default object
= {}it is transformed as expected toBabel Configuration (.babelrc)