Détail du package

estree-is-identifier

goto-bus-stop88.4kApache-2.01.0.0

check if an AST node is a call to require()

check, detect, estree, require

readme

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

changelog

estree-is-identifier change log

All notable changes to this project will be documented in this file.

This project adheres to Semantic Versioning.

1.0.0 / 2018-01-11

  • Initial release.