AST-query
AST-query copied to clipboard
Question: Adding an element to a shorthand object
I am trying to edit a file that has a block like this
const reducers = combineReducers({
app,
home
});
I have been able to add a new key to it using this command:
tree.callExpression('combineReducers').arguments.at(0).key('test').value('test')
This ends up creating code like this:
const reducers = combineReducers({
app,
home,
test: test
});
How can I get it to result in this??:
const reducers = combineReducers({
app,
home,
test
});
Do you know what is the AST tree of the desired syntax?