Skip to content

Commit

Permalink
add comments on mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
Emyrk committed Dec 10, 2024
1 parent f181da8 commit d08c147
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/mutations.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func SimplifyOmitEmpty(ts *guts.Typescript) {
})
}

// ExportTypes adds 'export' to all top level types.
// interface Foo {} --> export interface Foo{}
func ExportTypes(ts *guts.Typescript) {
ts.ForEach(func(key string, node bindings.Node) {
switch node := node.(type) {
Expand All @@ -51,6 +53,8 @@ func ExportTypes(ts *guts.Typescript) {
})
}

// ReadOnly sets all interface fields to 'readonly', resulting in
// all types being immutable.
// TODO: follow the AST all the way and find nested arrays
func ReadOnly(ts *guts.Typescript) {
ts.ForEach(func(key string, node bindings.Node) {
Expand Down

0 comments on commit d08c147

Please sign in to comment.