Noir::JSServerlessFunctionExtractor
Reads the handler exports of a file-routed serverless function module
(Cloudflare Pages Functions, Vercel Functions, Netlify Functions): which
names it exports, where each handler's parameter list and body are, the
inline config object, and the request params a handler body reads.
The URL comes from the file's location, so this layer only deals with
the module's contents. Discovery and body ranges come from the syntax
tree (Noir::JSHandlerTable); the request params are then read off the
body text.
Constants
Instance methods
The module's inline config object as string values by key, or nil:
export const config = {...} (optionally typed or satisfies), or the
config property of the default-exported object.
String values of key in a config object: path: "/a" or
path: ["/a", "/b"] (also quoted keys). Non-literal values are ignored.
The module's default export (export default ... or CommonJS
module.exports = ...). A default-exported object resolves to its
fetch method, the Fetchable-module shape. Nil when there is none.
The handler a module exports under name: export [async] function name(...), export const name = <fn>, CommonJS exports.name = <fn>,
or export { local as name }. Nil when the module does not export it.
callees also reads the handler's callees.
Request params a handler reads. style picks how the first parameter
is interpreted:
:request— it is the request (Vercel/Netlify(req, ...)), or destructures one.:context— it is an event context carrying.requestand.params(Cloudflare Pages(context)/({ request, params })).:lambda— it is a Lambda-style event (Netlify v1(event)):queryStringParameters,headers, a stringbody.