mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-07 00:49:12 +08:00
20 lines
No EOL
540 B
Text
20 lines
No EOL
540 B
Text
"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, true)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return (0, _helperValidatorIdentifier.isIdentifierName)(name);
|
|
} |