file-routing-expressjs
Version:
A dependency-free, flexible, system-based file routing for Express.
12 lines (9 loc) • 699 B
text/typescript
import { RequestHandler } from 'express';
import { ErrorHandler, ExpressMethod } from '../types/index.mjs';
declare function functionIsRequestHandler(handler: any): handler is RequestHandler;
declare function functionIsExceptionHandler(handler: any): handler is ErrorHandler;
declare function filenameIsJSorTS(filename: string): boolean;
declare function pathExistsAndIsFile(path: string): boolean;
declare function fileExistsAndIsJSorTS(filePath: string): boolean;
declare function methodIsExpressMethod(method: string): method is ExpressMethod;
export { fileExistsAndIsJSorTS, filenameIsJSorTS, functionIsExceptionHandler, functionIsRequestHandler, methodIsExpressMethod, pathExistsAndIsFile };