Skip to content

check if an AST node is an identifier, optionally with a specific name

License

Notifications You must be signed in to change notification settings

goto-bus-stop/estree-is-identifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

estree-is-identifier

check if an AST node is an identifier, optionally with a specific name

npm travis standard

Install

npm install estree-is-identifier

Usage

var isIdentifier = require('estree-is-identifier')

var node = parse('function a () {}')
isIdentifier(node) // false
var node = parse('abc')
isIdentifier(node) // true
isIdentifier(node, 'abc') // true
isIdentifier(node, 'xyz') // false

Also see the tests for more examples.

API

isIdentifier(node, name)

Check if node is an identifier. If name is given, check if the identifier has this name.

License

Apache-2.0

About

check if an AST node is an identifier, optionally with a specific name

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •