Don't use spread operator for Objects
ibc opened this issue · comments
Iñaki Baz Castillo commented
const _options = { ...defaultOptions, ...options };
/xxxx/node_modules/pick-port/index.js:51
const _options = { ...defaultOptions, ...options };
^^^
SyntaxError: Unexpected token ...
Spread operators it's not defined inES6 and it fails in Node 6 and 8:
Iñaki Baz Castillo commented
Instead, use Object.assign
. Also, let's avoid creating a ugly _options
variable:
options = Object.assign({}, defaultOptions, options);
José Luis Millán commented
Addressed in 0.0.3. Thanks @ibc!