Sha256: 2afa5f48325a284b4b53ec07a0efd11abd9e2b24697474115b38fd1316affa63

Contents?: true

Size: 589 Bytes

Versions: 29

Compression:

Stored size: 589 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = isValidIdentifier;

var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");

function isValidIdentifier(name, reserved = true) {
  if (typeof name !== "string") return false;

  if (reserved) {
    if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name)) {
      return false;
    } else if (name === "await") {
      return false;
    }
  }

  return (0, _helperValidatorIdentifier.isIdentifierName)(name);
}

Version data entries

29 entries across 29 versions & 4 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.7 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.6 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.5 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.4 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.3 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.2 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.1 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.3.5 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-5.0.0 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.3.4 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.3.3 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.3.2 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.3.1 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.3 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.2.3 node_modules/@babel/types/lib/validators/isValidIdentifier.js
tang-0.2.1 spec/tang_app/node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.2.2 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.2.1 node_modules/@babel/types/lib/validators/isValidIdentifier.js
trusty-cms-4.2 node_modules/@babel/types/lib/validators/isValidIdentifier.js