Skip to content

Commit

Permalink
feat: #343 - Ability to remove more object literal expression members
Browse files Browse the repository at this point in the history
  • Loading branch information
cancerberoSgx authored and dsherret committed Jun 9, 2018
1 parent 5d047a1 commit e82d45f
Show file tree
Hide file tree
Showing 16 changed files with 248 additions and 177 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="12.2.0"></a>
# [12.2.0](https://github.com/dsherret/ts-simple-ast/compare/12.1.0...12.2.0) (2018-06-04)


### Features

* Add Node.getStartColumn(), Node.getEndColumn(), SourceFile.getColumnAtPos(pos). ([5119e83](https://github.com/dsherret/ts-simple-ast/commit/5119e83))
* Add UserPreferences on sourceFile.organizeImports() ([6b0a089](https://github.com/dsherret/ts-simple-ast/commit/6b0a089))



<a name="12.1.0"></a>
# [12.1.0](https://github.com/dsherret/ts-simple-ast/compare/12.0.0...12.1.0) (2018-06-04)

Expand Down
9 changes: 9 additions & 0 deletions docs/details/object-literal-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,12 @@ const method = objectLiteralExpression.addMethod({
bodyText: `return "some string";`
});
```


### Removing

Remove a member by calling `.remove()` on it.

```ts
obj.getPropertyOrThrow("prop1").remove();
```
2 changes: 1 addition & 1 deletion docs/manipulation/removing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ enum MyEnum {

### Support

Currently removing is implemented individually for each kind of node. If you find something is not implemented, please open an issue on github.
Currently removing is implemented individually for each kind of node. In general this will work for many kind of nodes, including methods, properties, constructors, parmeters, statements, declarations. Nevertheless, if you find that `remove()` method is not implemented for a particular kind of Node, please open an issue on github.

0 comments on commit e82d45f

Please sign in to comment.