Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
92
Frontend-Learner/node_modules/reserved-identifiers/index.js
generated
vendored
Normal file
92
Frontend-Learner/node_modules/reserved-identifiers/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
// https://262.ecma-international.org/14.0/#sec-keywords-and-reserved-words
|
||||
// 14 is ES2023
|
||||
const identifiers = [
|
||||
// Keywords
|
||||
'await',
|
||||
'break',
|
||||
'case',
|
||||
'catch',
|
||||
'class',
|
||||
'const',
|
||||
'continue',
|
||||
'debugger',
|
||||
'default',
|
||||
'delete',
|
||||
'do',
|
||||
'else',
|
||||
'enum',
|
||||
'export',
|
||||
'extends',
|
||||
'false',
|
||||
'finally',
|
||||
'for',
|
||||
'function',
|
||||
'if',
|
||||
'import',
|
||||
'in',
|
||||
'instanceof',
|
||||
'new',
|
||||
'null',
|
||||
'return',
|
||||
'super',
|
||||
'switch',
|
||||
'this',
|
||||
'throw',
|
||||
'true',
|
||||
'try',
|
||||
'typeof',
|
||||
'var',
|
||||
'void',
|
||||
'while',
|
||||
'with',
|
||||
'yield',
|
||||
|
||||
// Future reserved keywords (strict mode)
|
||||
'implements',
|
||||
'interface',
|
||||
'let',
|
||||
'package',
|
||||
'private',
|
||||
'protected',
|
||||
'public',
|
||||
'static',
|
||||
|
||||
// Not keywords, but still restricted
|
||||
'arguments',
|
||||
'eval',
|
||||
];
|
||||
|
||||
// https://262.ecma-international.org/14.0/#sec-value-properties-of-the-global-object
|
||||
const globalProperties = [
|
||||
'globalThis',
|
||||
'Infinity',
|
||||
'NaN',
|
||||
'undefined',
|
||||
];
|
||||
|
||||
// These are TypeScript's built-in types that are reserved and cannot be used for type names
|
||||
const typeScriptTypes = [
|
||||
'any',
|
||||
'bigint',
|
||||
'boolean',
|
||||
'never',
|
||||
'null',
|
||||
'number',
|
||||
'object',
|
||||
'string',
|
||||
'symbol',
|
||||
'undefined',
|
||||
'unknown',
|
||||
'void',
|
||||
];
|
||||
|
||||
export default function reservedIdentifiers({includeGlobalProperties = false} = {}) {
|
||||
return new Set([
|
||||
...identifiers,
|
||||
...(includeGlobalProperties ? globalProperties : []),
|
||||
]);
|
||||
}
|
||||
|
||||
export function typeScriptReservedTypes() {
|
||||
return new Set(typeScriptTypes);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue