Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Adding an element to a shorthand object #33

Open
duro opened this issue Dec 29, 2016 · 1 comment
Open

Question: Adding an element to a shorthand object #33

duro opened this issue Dec 29, 2016 · 1 comment

Comments

@duro
Copy link

duro commented Dec 29, 2016

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
});
@SBoudrias
Copy link
Owner

Do you know what is the AST tree of the desired syntax?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants