Sha256: 90cebc648f7484f1ba3958f98e2faeceffcf7f5b5af4e4408e029b16566a9cd6

Contents?: true

Size: 1.51 KB

Versions: 40

Compression:

Stored size: 1.51 KB

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isReservedWord = isReservedWord;
exports.isStrictReservedWord = isStrictReservedWord;
exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
exports.isStrictBindReservedWord = isStrictBindReservedWord;
exports.isKeyword = isKeyword;
const reservedWords = {
  keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
  strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
  strictBind: ["eval", "arguments"]
};
const keywords = new Set(reservedWords.keyword);
const reservedWordsStrictSet = new Set(reservedWords.strict);
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);

function isReservedWord(word, inModule) {
  return inModule && word === "await" || word === "enum";
}

function isStrictReservedWord(word, inModule) {
  return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
}

function isStrictBindOnlyReservedWord(word) {
  return reservedWordsStrictBindSet.has(word);
}

function isStrictBindReservedWord(word, inModule) {
  return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
}

function isKeyword(word) {
  return keywords.has(word);
}

Version data entries

40 entries across 39 versions & 7 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.7 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.6 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.5 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.4 node_modules/@babel/helper-validator-identifier/lib/keyword.js
disco_app-0.16.1 test/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
disco_app-0.15.2 test/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.3 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.2 node_modules/@babel/helper-validator-identifier/lib/keyword.js
disco_app-0.18.4 test/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
disco_app-0.18.1 test/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
disco_app-0.14.0 test/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.1 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-4.3.5 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-5.0.0 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-4.3.4 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-4.3.3 node_modules/@babel/helper-validator-identifier/lib/keyword.js
trusty-cms-4.3.2 node_modules/@babel/helper-validator-identifier/lib/keyword.js