js-confuser
js-confuser copied to clipboard
Default property assignment using passed in variable fails
Describe the bug:
Default property assignment using passed in variable fails. The property must be assigned using a property name and a value.
Config and Small code sample
Config:
const partners = {joe:{id:1}};
Code:
const contacts = Object.keys(partners).reduce((contacts,name) => {
const {id} = partners[name];
// do NOT use contacts.push({id,name});
// the code breaks with the obfuscator
contacts.push({id,name:name});
return contacts;
},[]);
Expected behavior
[{id:1,name:"joe"}]
Actual behavior
[{id:1}]
Additional context
None