refactor: share the PRECHECK type at the top level
This commit is contained in:
parent
41c7802a36
commit
18b58ba94a
4 changed files with 9 additions and 9 deletions
|
@ -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[]>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue