refactor: share the PRECHECK type at the top level

This commit is contained in:
Andy Burke 2025-08-08 17:38:15 -07:00
parent 41c7802a36
commit 18b58ba94a
4 changed files with 9 additions and 9 deletions

View file

@ -8,12 +8,7 @@ import { walk } from '@std/fs';
import { delay } from '@std/async/delay';
import * as path from '@std/path';
import { getCookies } from '@std/http/cookie';
/** A `PRECHECK` must take a `Request` and `meta` data and return a `Response` IF THERE IS A PROBLEM. */
export type PRECHECK = (
request: Request,
meta: Record<string, any>
) => undefined | Response | Promise<undefined | Response>;
import { PRECHECK } from '@andyburke/serverus/server';
/** A `PRECHECK_TABLE` maps from HTTP methods to an array of `PRECHECK`s to be run. */
export type PRECHECKS_TABLE = Record<'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', PRECHECK[]>;