compare-path
Version:
An easy-to-use package to detect if two URLs match each other by comparing their abstract paths
7 lines • 457 B
TypeScript
import { ExtractRouteParams } from '../type-helpers/extract-route-params';
/**
* The comparePath function returns either a matching tuple [true, params] or [false, null] if the
* URL does not match the shape. The generic signature leverages the ExtractRouteParams type.
*/
export declare function comparePath<T extends string, U extends string>(shape: T, path: U): [true, ExtractRouteParams<T>] | [false, null];
//# sourceMappingURL=compare-path.d.ts.map