mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-10 04:00:10 +00:00
Merge pull request #34004 from AndrewLeedham/master
[@types/node-fetch] Make systemError optional
This commit is contained in:
3
types/node-fetch/index.d.ts
vendored
3
types/node-fetch/index.d.ts
vendored
@@ -4,6 +4,7 @@
|
||||
// Niklas Lindgren <https://github.com/nikcorg>
|
||||
// Vinay Bedre <https://github.com/vinaybedre>
|
||||
// Antonio Román <https://github.com/kyranet>
|
||||
// Andrew Leedham <https://github.com/AndrewLeedham>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -134,7 +135,7 @@ export class Body {
|
||||
|
||||
export class FetchError extends Error {
|
||||
name: "FetchError";
|
||||
constructor(message: string, type: string, systemError: string);
|
||||
constructor(message: string, type: string, systemError?: string);
|
||||
type: string;
|
||||
code?: string;
|
||||
errno?: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import fetch, { Headers, Request, RequestInit, Response } from 'node-fetch';
|
||||
import fetch, { Headers, Request, RequestInit, Response, FetchError } from 'node-fetch';
|
||||
import { Agent } from "http";
|
||||
|
||||
function test_fetchUrlWithOptions() {
|
||||
@@ -82,3 +82,8 @@ function test_isRedirect() {
|
||||
fetch.isRedirect(301);
|
||||
fetch.isRedirect(201);
|
||||
}
|
||||
|
||||
function test_FetchError() {
|
||||
new FetchError('message', 'type', 'systemError');
|
||||
new FetchError('message', 'type');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user