SupportBot 7.3

This commit is contained in:
ItzEmerald committed 2021-10-04 13:54:30 +01:00
1 parent 19a12f6c8f
commit 09f0873f27
4762 files changed
+504608 -52

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const identifierRegex = /^[a-z$_][$\w]*$/i;
const reservedSet = new Set([
'undefined',
'null',
'true',
'false',
'super',
'this',
'Infinity',
'NaN'
]);
/**
Test if the string is a valid JavaScript identifier.
@param string - String to test.
*/
exports.default = (string) => string && !reservedSet.has(string) && identifierRegex.test(string);