Skip to content

Commit d08c147

Browse files
committed
add comments on mutations
1 parent f181da8 commit d08c147

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

config/mutations.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ func SimplifyOmitEmpty(ts *guts.Typescript) {
3636
})
3737
}
3838

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

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

0 commit comments

Comments
 (0)