Recognize legacy @now/node type aliases

Extends the Vercel serverless handler detection to also match the
deprecated Zeit-era @now/node package with NowRequest/NowResponse
types. Per-review feedback from asgerf, these aliases still appear
in real-world code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
murderteeth
2026-04-13 17:31:29 +00:00
parent dfe05599d3
commit cff07342f5
3 changed files with 14 additions and 2 deletions

View File

@@ -32,8 +32,8 @@ module VercelNode {
this = any(Module m).getAnExportedValue("default").getAFunctionValue() and
req = this.getParameter(0) and
res = this.getParameter(1) and
req.hasUnderlyingType("@vercel/node", "VercelRequest") and
res.hasUnderlyingType("@vercel/node", "VercelResponse")
req.hasUnderlyingType(["@vercel/node", "@now/node"], ["NowRequest", "VercelRequest"]) and
res.hasUnderlyingType(["@vercel/node", "@now/node"], ["NowResponse", "VercelResponse"])
}
/** Gets the parameter that contains the request object. */