import { Except, Replace } from 'type-fest'; import { APIDef, RouteDef } from './route-def.js'; import './http-method.js'; /** * Use this to select a subset of your routes and strip a prefix from the route path. * * Not currently supported for the RouteDef[] input syntax. */ type FilterByAndStripPrefix = API extends Record ? { [K in keyof API as Replace]: K extends `${Prefix}${string}` ? Except & { route: Replace; } : never; } : never; export { FilterByAndStripPrefix };