Sha256: 7b8aeed9a6154c37775b5b0af8b0a259676012fad7419b5e54a467006cdc0f5f

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

{"version":3,"names":["_helperValidatorIdentifier","require","isValidIdentifier","name","reserved","isKeyword","isStrictReservedWord","isIdentifierName"],"sources":["../../src/validators/isValidIdentifier.ts"],"sourcesContent":["import {\n  isIdentifierName,\n  isStrictReservedWord,\n  isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\n/**\n * Check if the input `name` is a valid identifier name\n * and isn't a reserved word.\n */\nexport default function isValidIdentifier(\n  name: string,\n  reserved: boolean = true,\n): boolean {\n  if (typeof name !== \"string\") return false;\n\n  if (reserved) {\n    // \"await\" is invalid in module, valid in script; better be safe (see #4952)\n    if (isKeyword(name) || isStrictReservedWord(name, true)) {\n      return false;\n    }\n  }\n\n  return isIdentifierName(name);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,OAAA;AAUe,SAASC,iBAAiBA,CACvCC,IAAY,EACZC,QAAiB,GAAG,IAAI,EACf;EACT,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE,OAAO,KAAK;EAE1C,IAAIC,QAAQ,EAAE;IAEZ,IAAI,IAAAC,oCAAS,EAACF,IAAI,CAAC,IAAI,IAAAG,+CAAoB,EAACH,IAAI,EAAE,IAAI,CAAC,EAAE;MACvD,OAAO,KAAK;IACd;EACF;EAEA,OAAO,IAAAI,2CAAgB,EAACJ,IAAI,CAAC;AAC/B"}

Version data entries

3 entries across 1 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/@babel/helper-function-name/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map
trusty-cms-6.3.1 node_modules/@babel/traverse/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map
trusty-cms-6.3.1 node_modules/@babel/types/lib/validators/isValidIdentifier.js.map