You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because TS have some markers on SyntaxKind like FirstStatement and LastStatement to allow people to check if a syntax kind is a statement by checking if the value is in that range, doing SyntaxKind[node.kind] will give the marker name for node that are a boundary.
Describe the bug
Thank you so much for this tool!
Because TS have some markers on SyntaxKind like FirstStatement and LastStatement to allow people to check if a syntax kind is a statement by checking if the value is in that range, doing
SyntaxKind[node.kind]
will give the marker name for node that are a boundary.This is because all boundaries are at the end of the enum
I worked around in a project by keeping only the first value like this:
Then replace
SyntaxKind[node.kind]
bysyntaxKinds[node.kind]
I think adding this to [this file])(
ast-explorer/composables/parser/javascript/typescript.ts
Line 35 in 298b7e0
Reproduction
https://ast.sxzz.moe/#eNo9yLEKgCAQBuBXOf65oTWj12hyOUTEkFPUghDfvZtav4EEg4sfbq7G0rGgKPS3+B+cgsvSOjEdtO5KWWlYIbJILOHm4E9fW8xiYWjbrEzMD0YPHQ8=
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: