Skip to content

Commit

Permalink
fix: TypeScript declarations (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-guggisberg committed Apr 12, 2023
1 parent 3898f63 commit 503bb69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export class Headers implements Iterable<[string, string]> {
has(name: string): boolean;
set(name: string, value: string): void;

raw(): Record<string, string | string[]>;

entries(): Iterator<[string, string]>;
keys(): Iterator<string>;
values(): Iterator<string>;
Expand Down Expand Up @@ -298,8 +300,9 @@ export type SystemError = {
};

export class FetchError extends FetchBaseError {
code: number;
erroredSysCall?: SystemError;
code: string;
errno?: number;
erroredSysCall?: string;
}

export class AbortError extends FetchBaseError {
Expand Down
4 changes: 2 additions & 2 deletions src/fetch/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class FetchError extends FetchBaseError {
constructor(message, type, systemError) {
super(message, type);
if (systemError) {
// eslint-disable-next-line no-multi-assign
this.code = this.errno = systemError.code;
this.code = systemError.code;
this.errno = systemError.errno;
this.erroredSysCall = systemError.syscall;
}
}
Expand Down

0 comments on commit 503bb69

Please sign in to comment.