MCPcopy Index your code
hub / github.com/solidjs/solid-start / createWrapperFunction

Function createWrapperFunction

packages/start/src/http/index.ts:50–64  ·  view source on GitHub ↗
(
  h3Function: TFn,
)

Source from the content-addressed store, hash-verified

48>;
49
50function createWrapperFunction<TFn extends (...args: Array<any>) => any>(
51 h3Function: TFn,
52): WrapFunction<TFn> {
53 return ((...args: Array<any>) => {
54 const event = args[0];
55 if (!isEvent(event)) {
56 args.unshift(getEvent());
57 } else {
58 args[0] =
59 event instanceof h3.H3Event || (event as any).__is_event__ ? event : event[HTTPEventSymbol];
60 }
61
62 return (h3Function as any)(...args);
63 }) as any;
64}
65
66// Creating wrappers for each utility and exporting them with their original names
67// readRawBody => getWebRequest().text()/.arrayBuffer()

Callers 1

index.tsFile · 0.85

Calls 2

isEventFunction · 0.85
getEventFunction · 0.85

Tested by

no test coverage detected