Closed emilos closed 4 years ago
Sometimes it's useful to serialize an abstract syntax tree node to a value/object.
For example:
{ type: 'ArrayExpression', elements: [ { type: 'Literal', value: 1 }, { type: 'Literal', value: 2 }, { type: 'Literal', value: 3 }, { type: 'Literal', value: 4 }, { type: 'Literal', value: 5 } ] }
can be serialized to:
[1, 2, 3, 4, 5]
asttv
serialize
Context
Sometimes it's useful to serialize an abstract syntax tree node to a value/object.
For example:
can be serialized to:
Acceptance criteria
asttv
(https://github.com/buxlabs/asttv)serialize
method