Skip to content

Commit

Permalink
Document ParameterError
Browse files Browse the repository at this point in the history
  • Loading branch information
colincasey committed Apr 12, 2024
1 parent 17c8081 commit 031d7b8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 23 deletions.
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ docs/*.md

# subsequent PRs will un-ignore areas that are under review until
# all docs are complete and we can drop this ignore file entirely
!docs/tough-cookie.parametererror.md
15 changes: 15 additions & 0 deletions api/docs/tough-cookie.parametererror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [tough-cookie](./tough-cookie.md) &gt; [ParameterError](./tough-cookie.parametererror.md)

## ParameterError class

Represents a validation error.

**Signature:**

```typescript
export declare class ParameterError extends Error
```
**Extends:** Error
48 changes: 25 additions & 23 deletions api/tough-cookie.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@

/// <reference types="node" />

// Warning: (ae-forgotten-export) The symbol "Nullable" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function canonicalDomain(str: string | null): string | null;
export function canonicalDomain(str: Nullable<string>): string | undefined;

// @public (undocumented)
export class Cookie {
// Warning: (ae-forgotten-export) The symbol "CreateCookieOptions" needs to be exported by the entry point index.d.ts
constructor(options?: CreateCookieOptions);
// (undocumented)
canonicalizedDomain(): string | null;
canonicalizedDomain(): string | undefined;
// (undocumented)
cdomain(): string | null;
cdomain(): string | undefined;
// (undocumented)
clone(): Cookie | null;
clone(): Cookie | undefined;
// (undocumented)
static cookiesCreated: number;
// (undocumented)
Expand Down Expand Up @@ -100,7 +102,7 @@ export function cookieCompare(a: Cookie, b: Cookie): number;
// @public (undocumented)
export class CookieJar {
// Warning: (ae-forgotten-export) The symbol "CreateCookieJarOptions" needs to be exported by the entry point index.d.ts
constructor(store?: Store | null | undefined, options?: CreateCookieJarOptions | boolean);
constructor(store?: Nullable<Store>, options?: CreateCookieJarOptions | boolean);
// (undocumented)
clone(callback: Callback<CookieJar>): void;
// (undocumented)
Expand Down Expand Up @@ -198,29 +200,29 @@ export class CookieJar {
}

// @public (undocumented)
export function defaultPath(path?: string | null): string;
export function defaultPath(path?: Nullable<string>): string;

// @public (undocumented)
export function domainMatch(str?: string | null, domStr?: string | null, canonicalize?: boolean): boolean | null;
export function domainMatch(str?: Nullable<string>, domStr?: Nullable<string>, canonicalize?: boolean): boolean | undefined;

// @public
export function formatDate(date: Date): string;

// @public (undocumented)
export const fromJSON: (str: unknown) => Cookie | null;
export const fromJSON: (str: unknown) => Cookie | undefined;

// Warning: (ae-forgotten-export) The symbol "GetPublicSuffixOptions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function getPublicSuffix(domain: string, options?: GetPublicSuffixOptions): string | null;
export function getPublicSuffix(domain: string, options?: GetPublicSuffixOptions): string | undefined;

// @public (undocumented)
export class MemoryCookieStore extends Store {
constructor();
// (undocumented)
findCookie(domain: string | null, path: string | null, key: string | undefined): Promise<Cookie | undefined>;
findCookie(domain: Nullable<string>, path: Nullable<string>, key: Nullable<string>): Promise<Cookie | undefined>;
// (undocumented)
findCookie(domain: string | null, path: string | null, key: string | undefined, callback: Callback<Cookie | undefined>): void;
findCookie(domain: Nullable<string>, path: Nullable<string>, key: Nullable<string>, callback: Callback<Cookie | undefined>): void;
// (undocumented)
findCookies(domain: string, path: string, allowSpecialUseDomain?: boolean): Promise<Cookie[]>;
// (undocumented)
Expand Down Expand Up @@ -257,23 +259,23 @@ export class MemoryCookieStore extends Store {
updateCookie(oldCookie: Cookie, newCookie: Cookie, callback: ErrorCallback): void;
}

// @public (undocumented)
// @public
export class ParameterError extends Error {
}

// @public (undocumented)
export const parse: (str: string, options?: {
loose?: boolean | undefined;
} | undefined) => Cookie | null | undefined;
} | undefined) => Cookie | undefined;

// @public (undocumented)
export function parseDate(str: string | undefined | null): Date | undefined;
export function parseDate(str: Nullable<string>): Date | undefined;

// @public (undocumented)
export function pathMatch(reqPath: string, cookiePath: string): boolean;

// @public (undocumented)
export function permuteDomain(domain: string, allowSpecialUseDomain?: boolean): string[] | null;
export function permuteDomain(domain: string, allowSpecialUseDomain?: boolean): string[] | undefined;

// @public
export function permutePath(path: string): string[];
Expand All @@ -289,13 +291,13 @@ export const PrefixSecurityEnum: Readonly<{
export class Store {
constructor();
// (undocumented)
findCookie(domain: string | null, path: string | null, key: string | undefined): Promise<Cookie | null | undefined>;
findCookie(domain: Nullable<string>, path: Nullable<string>, key: Nullable<string>): Promise<Cookie | undefined>;
// (undocumented)
findCookie(domain: string | null, path: string | null, key: string | undefined, callback: Callback<Cookie | null | undefined>): void;
findCookie(domain: Nullable<string>, path: Nullable<string>, key: Nullable<string>, callback: Callback<Cookie | undefined>): void;
// (undocumented)
findCookies(domain: string | null, path: string | null, allowSpecialUseDomain?: boolean): Promise<Cookie[]>;
findCookies(domain: Nullable<string>, path: Nullable<string>, allowSpecialUseDomain?: boolean): Promise<Cookie[]>;
// (undocumented)
findCookies(domain: string | null, path: string | null, allowSpecialUseDomain?: boolean, callback?: Callback<Cookie[]>): void;
findCookies(domain: Nullable<string>, path: Nullable<string>, allowSpecialUseDomain?: boolean, callback?: Callback<Cookie[]>): void;
// (undocumented)
getAllCookies(): Promise<Cookie[]>;
// (undocumented)
Expand All @@ -309,13 +311,13 @@ export class Store {
// (undocumented)
removeAllCookies(callback: ErrorCallback): void;
// (undocumented)
removeCookie(domain: string | null | undefined, path: string | null | undefined, key: string | null | undefined): Promise<void>;
removeCookie(domain: Nullable<string>, path: Nullable<string>, key: Nullable<string>): Promise<void>;
// (undocumented)
removeCookie(domain: string | null | undefined, path: string | null | undefined, key: string | null | undefined, callback: ErrorCallback): void;
removeCookie(domain: Nullable<string>, path: Nullable<string>, key: Nullable<string>, callback: ErrorCallback): void;
// (undocumented)
removeCookies(domain: string, path: string | null): Promise<void>;
removeCookies(domain: string, path: Nullable<string>): Promise<void>;
// (undocumented)
removeCookies(domain: string, path: string | null, callback: ErrorCallback): void;
removeCookies(domain: string, path: Nullable<string>, callback: ErrorCallback): void;
// (undocumented)
synchronous: boolean;
// (undocumented)
Expand Down
4 changes: 4 additions & 0 deletions lib/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ export function validate(
else throw err
}

/**
* Represents a validation error.
* @public
*/
export class ParameterError extends Error {}

0 comments on commit 031d7b8

Please sign in to comment.