thingtalk icon indicating copy to clipboard operation
thingtalk copied to clipboard

optimize.ts contains a lot of wrapper functions

Open george1459 opened this issue 1 year ago • 0 comments

it's unclear currently why some objects have .optimize() method while some do not. Examples of some that do include: Ast.Input and Ast.BooleanExpression, while those that don't include Ast.Expression and Ast.Statement. However, it seems if an object does not have such a method, you can find a function in optimize.ts that provides the functionality. This inconsistency can be confusing to developers.

If it makes sense to add an .optimize() method for all nodes, I believe we should go ahead and do it.

george1459 avatar Jul 28 '22 19:07 george1459