class

Analyzer::Javascript::Nestjs

Inherits Analyzer::Javascript::JavascriptEngine < Analyzer < FileHelper < Reference < Object

Constants

GLOBAL_LITERAL_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]

Extensions worth scanning for cross-file enum/object constants — the enum may live in a .ts file even when the route-scan pass only walks .js, so cast a wide net here.

NEST_CONFIG_BASENAMES = ["nest-cli.json"]
NEST_PACKAGE_MARKERS = ["@nestjs/core", "@nestjs/common"]

Markers that identify a NestJS application root, so a prefix set in one app's bootstrap is not stamped onto another app's controllers.

NESTJS_BOOTSTRAP_RE = Regex.union("NestFactory.create", "from '@nestjs/core'", "from \"@nestjs/core\"", "require('@nestjs/core')", "require(\"@nestjs/core\")")

Precompiled once — a single PCRE2-JIT scan replaces five naive String#includes? substring scans over the whole file content. Regex.union auto-escapes each literal, so this is provably equivalent to the OR-of-includes? it replaces.

REQUEST_OBJECT_FIELDS = { {"query", "query"}, {"body", "body"}, {"headers", "header"}, {"params", "path"} }

Request-object fields read in handler bodies, paired with the param type they map to. Iterated in this order when extracting params.

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source