module
Analyzer::Javascript::ExpressConstants
Overview
Constants for Express router prefix tracking in CodeLocator
Direct including types
Defined in:
analyzer/analyzers/javascript/express_constants.crConstant Summary
-
ENTRY_FILENAMES =
["server.js", "app.js", "index.js", "main.js", "server.ts", "app.ts", "index.ts", "main.ts"] -
Common entry point filenames for Express applications
-
ENTRY_SUBDIRS =
["src", "lib", "app"] -
Common subdirectories to check for entry points
-
JS_EXTENSIONS =
[".js", ".ts", ".jsx", ".tsx"] -
JavaScript/TypeScript file extensions
-
SKIP_IDENTIFIERS =
["req", "res", "next", "err", "error", "true", "false", "null", "undefined"] -
Common identifiers to skip when scanning for router variables
Class Method Summary
-
.file_key(file_path : String) : Noir::LocatorKey(Array(String))
File- and function-level keys for the router prefixes this analyzer stashes in
CodeLocator. - .function_key(file_path : String, function_name : String) : Noir::LocatorKey(Array(String))
Class Method Detail
File- and function-level keys for the router prefixes this analyzer
stashes in CodeLocator. The names are minted from the scanned path,
so they cannot be constants — they come from the declared
EXPRESS_ROUTER_PREFIX namespace instead, which is what puts them
under the same lifecycle and enforcement as every other slot.
def self.function_key(file_path : String, function_name : String) : Noir::LocatorKey(Array(String))
#