## Index

### Classes

- Cookie
- CookieJar
- MemoryCookieStore
- Store

### Functions

- canonicalDomain
- cookieCompare
- defaultPath
- domainMatch
- formatDate
- fromJSON
- getPublicSuffix
- parseDate
- pathMatch
- permuteDomain
- permutePath

## Functions

### canonicalDomain

- canonicalDomain(str: string): string

- - Defined in node_modules/@types/tough-cookie/index.d.ts:26

  Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).

  #### Parameters

  - ##### str: string

  #### Returns string

### cookieCompare

- cookieCompare(a: Cookie, b: Cookie): number

- - Defined in node_modules/@types/tough-cookie/index.d.ts:61

  #### Parameters

  - ##### a: Cookie

  - ##### b: Cookie

  #### Returns number

### defaultPath

- defaultPath(path: string): string

- - Defined in node_modules/@types/tough-cookie/index.d.ts:44

  Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC.

  The path parameter MUST be only the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the .pathname property of node's uri.parse() output.

  #### Parameters

  - ##### path: string

  #### Returns string

### domainMatch

- domainMatch(str: string, domStr: string, canonicalize?: undefined | false | true): boolean

- - Defined in node_modules/@types/tough-cookie/index.d.ts:35

  Answers "does this real domain match the domain in a cookie?". The str is the "current" domain-name and the domStr is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match".

  The canonicalize parameter will run the other two parameters through canonicalDomain or not.

  #### Parameters

  - ##### str: string

  - ##### domStr: string

  - ##### Optional canonicalize: undefined | false | true

  #### Returns boolean

### formatDate

- formatDate(date: Date): string

- - Defined in node_modules/@types/tough-cookie/index.d.ts:18

  Format a Date into a RFC1123 string (the RFC6265-recommended format).

  #### Parameters

  - ##### date: Date

  #### Returns string

### fromJSON

- fromJSON(string: string): Cookie

- - Defined in node_modules/@types/tough-cookie/index.d.ts:57

  alias for Cookie.fromJSON(string)

  #### Parameters

  - ##### string: string

  #### Returns Cookie

### getPublicSuffix

- getPublicSuffix(hostname: string): string | null

- - Defined in node_modules/@types/tough-cookie/index.d.ts:59

  #### Parameters

  - ##### hostname: string

  #### Returns string | null

### parseDate

- parseDate(string: string): Date

- - Defined in node_modules/@types/tough-cookie/index.d.ts:13

  Parse a cookie date string into a Date. Parses according to RFC6265 Section 5.1.1, not Date.parse().

  #### Parameters

  - ##### string: string

  #### Returns Date

### pathMatch

- pathMatch(reqPath: string, cookiePath: string): boolean

- - Defined in node_modules/@types/tough-cookie/index.d.ts:52

  Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean.

  This is essentially a prefix-match where cookiePath is a prefix of reqPath.

  #### Parameters

  - ##### reqPath: string

  - ##### cookiePath: string

  #### Returns boolean

### permuteDomain

- permuteDomain(domain: string): string[]

- - Defined in node_modules/@types/tough-cookie/index.d.ts:63

  #### Parameters

  - ##### domain: string

  #### Returns string[]

### permutePath

- permutePath(path: string): string[]

- - Defined in node_modules/@types/tough-cookie/index.d.ts:65

  #### Parameters

  - ##### path: string

  #### Returns string[]

Generated using TypeDoc