@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
22 lines (21 loc) • 998 B
TypeScript
/**
* Path matching shared by the adapters' middleware `paths` / `excludePaths`
* and the rate limiters' `skipPaths`.
*
* Every match is at a segment boundary: a pattern names the path itself and
* what lies under it as a directory would, so `/api/health` covers
* `/api/health` and `/api/health/live` but not `/api/healthz`. The plain
* prefix test the adapters used to run let the second be exempted by the
* first.
*
* @module server/utils/pathMatch
*/
/** The request path without its query string or fragment. */
export declare function stripQuery(path: string): string;
/**
* `true` when `path` is `prefix`, or lies under `prefix` at a segment
* boundary. `"*"`, `""` and `"/"` match every path.
*/
export declare function pathStartsWithSegment(path: string, prefix: string): boolean;
/** `true` when any of `prefixes` matches `path` (see {@link pathStartsWithSegment}). */
export declare function pathMatchesAny(path: string, prefixes: readonly string[] | undefined): boolean;