Analyzer::Javascript::Nextjs
Inherits Analyzer::Javascript::JavascriptEngine < Analyzer < FileHelper < Reference < Object
Constants
export const { POST } = serve<Input>(...) — handler(s) destructured
from a factory call (e.g. @upstash/workflow/nextjs). The plain brace
regex misses it because const sits between export and {.
Compiled once per verb — interpolated regex literals would otherwise be rebuilt (full PCRE2 compile) for every method on every file.
Unlike every other JS/TS splitter this one has NO quote handling at all,
counts < > as nesting, and neither strips nor drops empty parts —
reproduced verbatim from the body it replaces.
The two callers explain the shape: exported_alias_for_method passes the
inside of an export { a, b as c } clause and
extract_server_action_params passes a TypeScript parameter list, so
generics have to nest ({ params }: { params: Promise<{ id: string }> })
but neither input can contain a string literal. Both strip each part and
skip the empties themselves.
Class methods
Instance methods
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.