Skip to content

Question: Adding an element to a shorthand object #33

@duro

Description

@duro

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
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions