hughsk / hughsk/ast-declaration-source
Clarify in README that "node" should be an "Identifier" node
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Thanks for the library.
It works with the latest version of acorn.
Currently, the README says:
```
declaration = source(node)
Given a node within an AST generated by esprima or acorn, determine the original declaration node in the tree.
```
After playing with the library, one thing I notice is that `node` should have `type` of `Identifier`. This should be clarified in README.
The example in README can be improved like this:
```js
...
var walk = require('acorn-walk')
...
walk.simple(ast, {
Identifier(node) {
var declNode = source(node)
...
}
});
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.