reserved-words

WebJar for reserved-words

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

reserved-words
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

reserved-words
WebJar for reserved-words
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/zxqfox/reserved-words

Download reserved-words

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/reserved-words/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>reserved-words</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/reserved-words/
implementation 'org.webjars.npm:reserved-words:0.1.2'
// https://jarcasting.com/artifacts/org.webjars.npm/reserved-words/
implementation ("org.webjars.npm:reserved-words:0.1.2")
'org.webjars.npm:reserved-words:jar:0.1.2'
<dependency org="org.webjars.npm" name="reserved-words" rev="0.1.2">
  <artifact name="reserved-words" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='reserved-words', version='0.1.2')
)
libraryDependencies += "org.webjars.npm" % "reserved-words" % "0.1.2"
[org.webjars.npm/reserved-words "0.1.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

reserved-words

Build Status

What is it?

Tiny package for detecting reserved words.

Reserved Word is either a Keyword, or a Future Reserved Word, or a Null Literal, or a Boolean Literal. See: ES5 #7.6.1 and ES6 #11.6.2.

Installation

npm install reserved-words

API

check(word, [dialect], [strict])

Returns true if provided identifier string is a Reserved Word in some ECMAScript dialect (ECMA-262 edition).

If the strict flag is truthy, this function additionally checks whether word is a Keyword or Future Reserved Word under strict mode.

Example

var reserved = require('reserved-words');
reserved.check('volatile', 'es3'); // true
reserved.check('volatile', 'es2015'); // false
reserved.check('yield', 3); // false
reserved.check('yield', 6); // true

dialects

es3 (or 3)

Represents ECMA-262 3rd edition.

See section 7.5.1.

es5 (or 5)

Represents ECMA-262 5th edition (ECMAScript 5.1).

Reserved Words are formally defined in ECMA262 sections 7.6.1.1 and 7.6.1.2.

es2015 (or es6, 6)

Represents [ECMA-262 6th edition](ECMAScript 2015).

Reserved Words are formally defined in sections 11.6.2.1 and 11.6.2.2.

License

Licensed under The MIT License

Versions

Version
0.1.2
0.1.1