estree-is-member-expression
check if an AST node is a MemberExpression, in general or a specific one
Last updated 3 years ago by goto-bus-stop .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install estree-is-member-expression 
SYNC missed versions from official npm registry.

estree-is-member-expression

check if an AST node is a MemberExpression, in general or a specific one

npm travis standard

Install

npm install estree-is-member-expression

Usage

var isMemberExpression = require('estree-is-member-expression')

var node = parse('function a () {}')
isMemberExpression(node) // false
var node = parse('module.exports')
isMemberExpression(node) // true
isMemberExpression(node, 'module.exports') // true
isMemberExpression(node, 'module.filename') // false
isMemberExpression(node, 'module.filename.toString') // false
var node = parse('module.filename.toString')
isMemberExpression(node, 'module.filename.toString') // true

Also see the tests for more examples.

API

isMemberExpression(node, pattern)

Check if node is a MemberExpression. If pattern is given, check if node is a MemberExpression matching the pattern. pattern can be a .-delimited string or an array. The pattern can contain more than two elements, all of them must match.

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 46
This Month 90
Last Day 3
Last Week 41
Last Month 235
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2014 - 2017 © taobao.org |