MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / implicitResponseStatus

Function implicitResponseStatus

src/ui-server/api/effects.ts:493–504  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

491 * `sendStatus`), or when the call is not one of these.
492 */
493export function implicitResponseStatus(text: string): number | null {
494 const call = normaliseCall(text);
495 if (/(?:^|\.)(?:status|sendStatus|code|Status|StatusCode|SendStatus|withStatus|with_status|writeHead)\(/.test(call)) return null;
496 const bare = call.replace(/\([^()]*\)/g, '');
497 if (/^(?:res|response|reply|rep|ctx|c|context)(?:\.(?:type|set|header|headers|append|cookie|clearCookie|vary|location|links|format))*\.(?:json|jsonp|send|render|sendFile|download|text|html|body|stream|file|view)$/.test(bare)) return 200;
498 if (/^(?:NextResponse|Response)\.json$/.test(bare)) return 200;
499 if (/^(?:JSONResponse|HTMLResponse|PlainTextResponse|ORJSONResponse|UJSONResponse|jsonify|render_template|render|make_response|HttpResponse|JsonResponse|send_file|send_from_directory)$/.test(bare)) return 200;
500 if (/^(?:render|render_to_string|respond_with)$/.test(bare)) return 200;
501 if (/^ModelAndView$/.test(bare)) return 200;
502 if (/^response\(\)->(?:json|view)$|^response->json$|^view$/.test(call.replace(/\s+/g, ''))) return 200;
503 return null;
504}
505
506/** The abbreviated argument list split on its top-level commas. */
507function splitArgs(args: string): string[] {

Callers 3

effectLinkFunction · 0.90
statusFunction · 0.90
ui-effects.test.tsFile · 0.90

Calls 1

normaliseCallFunction · 0.85

Tested by 1

statusFunction · 0.72