remove PropertyAssignament from ObjectLiteralExpression
See original GitHub issueHello, before throwing myself to the water and implement it, I would like to know if there is some way of removing a PropertyAssignament
from an ObjectLiteralExpression
, example:
given an object literal {name: 'seba', lastname: 'gurin'}
and I want to remove property ‘name’ so the resulting object is {lastname: 'gurin'}
Thanks in advanced
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Remove a property from an object in JavaScript - Techie Delight
1. Using Delete Operator. The delete operator removes a given property from an object, returning true or false as appropriate on success and...
Read more >How do I remove a property from a JavaScript object?
To remove a property from an object (mutating the object), you can do it like this: delete myObject.regex; // or, delete myObject['regex']; //...
Read more >delete operator - JavaScript - MDN Web Docs - Mozilla
The delete operator removes a property from an object. If the property's value is an object and there are no more references to...
Read more >How To Add, Modify and Delete JavaScript Object Literal ...
The delete keyword deletes both the value of the property and the property itself. After deletion, the property cannot be used before it...
Read more >Object Literal Expressions - ts-morph
Object Literal Expressions · Properties · Property Assignments · Shorthand Property Assignments · Spread Assignments · Accessors · Methods · Removing.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I missed a few things in the review so did a new commit. This should be good to go so I’m doing a release now.
I’d rather implement it for the scenario and have people submit pull requests/report an issue when something’s not implemented. That way everyone can benefit. Additionally, there can be a lot of edge cases and exposing
removeChildren
would just lead to people opening bug reports when it doesn’t work the way they expect it to.