Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { TSESTree } from "@typescript-eslint/utils";
import * as getJson from "./data/getFunctions.json";
const getFunctions: Set<string> = new Set<string>(getJson.getFunctions);
const getOrNullObjectFunctions: Set<string> = new Set<string>(
getJson.getOrNullObjectFunctions,
);
export function isGetFunction(node: TSESTree.Node): boolean {
return (
node.type == TSESTree.AST_NODE_TYPES.CallExpression &&
node.callee.type === TSESTree.AST_NODE_TYPES.MemberExpression &&
node.callee.property.type === TSESTree.AST_NODE_TYPES.Identifier &&
(getFunctions.has(node.callee.property.name) ||
getOrNullObjectFunctions.has(node.callee.property.name))
);
}
export function isGetOrNullObjectFunction(node: TSESTree.Node): boolean {
return (
node.type == TSESTree.AST_NODE_TYPES.CallExpression &&
node.callee.type === TSESTree.AST_NODE_TYPES.MemberExpression &&
node.callee.property.type === TSESTree.AST_NODE_TYPES.Identifier &&
getOrNullObjectFunctions.has(node.callee.property.name)
);
}