merge icon indicating copy to clipboard operation
merge copied to clipboard

Symbol properties are ignored

Open natesilva opened this issue 6 years ago • 0 comments

Symbols can be used as property keys, but they are ignored.

const merge = require('merge');

const mySymbol = Symbol('mySymbol');

const x = { value: 42, [mySymbol]: 'hello' };

console.log(x);
// { value: 42, [Symbol(mySymbol)]: 'hello' }

const y = { other: 33 };
const z = merge(true, x, y);

console.log(z);
// { value: 42, other: 33 }
// expected: { value: 42, other: 33, [Symbol(mySymbol)]: 'hello' }

natesilva avatar Jun 19 '19 22:06 natesilva