Home > tough-cookie > permutePath
Generates the permutation of all possible values that pathMatch() the path
parameter. The array is in longest-to-shortest order. Useful when building custom Store implementations.
Signature:
export declare function permutePath(path: string): string[];
Parameter |
Type |
Description |
---|---|---|
path |
string |
the path to generate permutations for |
string[]
permutePath('/foo/bar/')
// ['/foo/bar/', '/foo/bar', '/foo', '/']