-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ef4216
commit 195747e
Showing
4 changed files
with
92 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [tough-cookie](./tough-cookie.md) > [permuteDomain](./tough-cookie.permutedomain.md) | ||
|
||
## permuteDomain() function | ||
|
||
Generates the permutation of all possible values that [domainMatch()](./tough-cookie.domainmatch.md) the given `domain` parameter. The array is in shortest-to-longest order. Useful when building custom [Store](./tough-cookie.store.md) implementations. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare function permuteDomain(domain: string, allowSpecialUseDomain?: boolean): string[] | undefined; | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
|
||
</th><th> | ||
|
||
Type | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
domain | ||
|
||
|
||
</td><td> | ||
|
||
string | ||
|
||
|
||
</td><td> | ||
|
||
the domain to generate permutations for | ||
|
||
|
||
</td></tr> | ||
<tr><td> | ||
|
||
allowSpecialUseDomain | ||
|
||
|
||
</td><td> | ||
|
||
boolean | ||
|
||
|
||
</td><td> | ||
|
||
_(Optional)_ flag to control if [Special Use Domains](https://www.rfc-editor.org/rfc/rfc6761.html) such as `localhost` should be allowed | ||
|
||
|
||
</td></tr> | ||
</tbody></table> | ||
**Returns:** | ||
|
||
string\[\] \| undefined | ||
|
||
## Example | ||
|
||
|
||
``` | ||
permuteDomain('foo.bar.example.com') | ||
// ['example.com', 'bar.example.com', 'foo.bar.example.com'] | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters