Version 1.0.2 mit node_modules Verzeichnis

This commit is contained in:
ISA
2024-10-02 07:58:24 +02:00
parent f353a06b1b
commit 62b6e55a0a
68228 changed files with 4548477 additions and 651 deletions

View File

@@ -0,0 +1,24 @@
/// <reference types="node" />
import type { StackFrame } from 'stacktrace-parser';
import type { ServerResponse } from 'http';
export type SourcePackage = 'react' | 'next';
export interface OriginalStackFrameResponse {
originalStackFrame?: StackFrame | null;
originalCodeFrame?: string | null;
/** We use this to group frames in the error overlay */
sourcePackage?: SourcePackage | null;
}
/** Given a frame, it parses which package it belongs to. */
export declare function findSourcePackage({ file, methodName, }: Partial<{
file: string | null;
methodName: string | null;
}>): SourcePackage | undefined;
/**
* It looks up the code frame of the traced source.
* @note It ignores node_modules or Next.js/React internals, as these can often be huge budnled files.
*/
export declare function getOriginalCodeFrame(frame: StackFrame, source: string | null): string | null | undefined;
export declare function noContent(res: ServerResponse): void;
export declare function badRequest(res: ServerResponse): void;
export declare function internalServerError(res: ServerResponse, e?: any): void;
export declare function json(res: ServerResponse, data: any): void;