estree-assign-parent
assign `.parent` properties to all nodes in an ast.
Last updated 3 years ago by goto-bus-stop .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install estree-assign-parent 
SYNC missed versions from official npm registry.

estree-assign-parent

assign .parent properties to all nodes in an ast.

npm travis standard

Install

npm install estree-assign-parent

Usage

var assignParent = require('estree-assign-parent')

var ast = assignParent(parse(`
  module.exports = function xyz () {
    return xyz.toString()
  }
`))

assert.equal(ast.body[0].parent, ast)

API

assignParent(ast, key='parent')

Add a parent key to all nodes belonging to ast, referring to the parent node. The key option can be used to assign a different name, like 'parentNode'.

License

Apache-2.0

Current Tags

  • 1.0.0                                ...           latest (3 years ago)

1 Versions

  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |