Skip to content

Latest commit

 

History

History
61 lines (31 loc) · 906 Bytes

tough-cookie.permutepath.md

File metadata and controls

61 lines (31 loc) · 906 Bytes

Home > tough-cookie > permutePath

permutePath() function

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[];

Parameters

Parameter

Type

Description

path

string

the path to generate permutations for

**Returns:**

string[]

Example

permutePath('/foo/bar/')
// ['/foo/bar/', '/foo/bar', '/foo', '/']