dsherret / dsherret/ts-morph

Ability to insert/add clauses into a switch statement

Open
#216 3 comments 1 reaction 0 assignees View on GitHub
domain: manipulation
Dominant language
TypeScript
Stars
6.2k
Forks
238
Avg merge
2m
Merged PRs (30d)
1

Description

Need to think this through...

```ts
const switchStatement = ...;
switchStatement.insertClause(0, {
caseLabel: "5",
body: "console.log(5);" // or writer => writer.writeLine(5);
});
switchStatement.insertClause(0, {
caseLabel: "9"
});

switchStatement.insertClause(0, {
isDefault: true // i don't really like this...
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.