()
| 16 | } |
| 17 | |
| 18 | func (t typescriptNode) applyMutations() (typescriptNode, error) { |
| 19 | for i, m := range t.mutations { |
| 20 | var err error |
| 21 | t.Node, err = m(t.Node) |
| 22 | if err != nil { |
| 23 | return t, fmt.Errorf("apply mutation %d: %w", i, err) |
| 24 | } |
| 25 | } |
| 26 | t.mutations = nil |
| 27 | return t, nil |
| 28 | } |
| 29 | |
| 30 | func (t *typescriptNode) AddEnum(member *bindings.EnumMember) { |
| 31 | t.mutations = append(t.mutations, func(v bindings.Node) (bindings.Node, error) { |