mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
fix(node): add undefined return to url in inspector (#35204)
This commit fixes the return type of the `url` function from the `inspector` Node module. The value `undefined` is returned when there is no active inspector.
This commit is contained in:
committed by
Sheetal Nandi
parent
b3c4e2af48
commit
b6ff9c2306
Vendored
+2
-2
@@ -3251,7 +3251,7 @@ declare module "inspector" {
|
||||
function close(): void;
|
||||
|
||||
/**
|
||||
* Return the URL of the active inspector, or undefined if there is none.
|
||||
* Return the URL of the active inspector, or `undefined` if there is none.
|
||||
*/
|
||||
function url(): string;
|
||||
function url(): string | undefined;
|
||||
}
|
||||
|
||||
@@ -1090,7 +1090,7 @@ import * as constants from 'constants';
|
||||
inspector.open(0, 'localhost');
|
||||
inspector.open(0, 'localhost', true);
|
||||
inspector.close();
|
||||
const inspectorUrl: string = inspector.url();
|
||||
const inspectorUrl: string | undefined = inspector.url();
|
||||
|
||||
const session = new inspector.Session();
|
||||
session.connect();
|
||||
|
||||
@@ -73,7 +73,7 @@ declare module "inspector" {
|
||||
function close(): void;
|
||||
|
||||
/**
|
||||
* Return the URL of the active inspector, or undefined if there is none.
|
||||
* Return the URL of the active inspector, or `undefined` if there is none.
|
||||
*/
|
||||
function url(): string;
|
||||
function url(): string | undefined;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -3156,7 +3156,7 @@ declare module "inspector" {
|
||||
function close(): void;
|
||||
|
||||
/**
|
||||
* Return the URL of the active inspector, or undefined if there is none.
|
||||
* Return the URL of the active inspector, or `undefined` if there is none.
|
||||
*/
|
||||
function url(): string;
|
||||
function url(): string | undefined;
|
||||
}
|
||||
|
||||
@@ -4822,7 +4822,7 @@ import * as constants from 'constants';
|
||||
inspector.open(0, 'localhost');
|
||||
inspector.open(0, 'localhost', true);
|
||||
inspector.close();
|
||||
const inspectorUrl: string = inspector.url();
|
||||
const inspectorUrl: string | undefined = inspector.url();
|
||||
|
||||
const session = new inspector.Session();
|
||||
session.connect();
|
||||
|
||||
Vendored
+2
-2
@@ -3251,7 +3251,7 @@ declare module "inspector" {
|
||||
function close(): void;
|
||||
|
||||
/**
|
||||
* Return the URL of the active inspector, or undefined if there is none.
|
||||
* Return the URL of the active inspector, or `undefined` if there is none.
|
||||
*/
|
||||
function url(): string;
|
||||
function url(): string | undefined;
|
||||
}
|
||||
|
||||
@@ -1090,7 +1090,7 @@ import * as constants from 'constants';
|
||||
inspector.open(0, 'localhost');
|
||||
inspector.open(0, 'localhost', true);
|
||||
inspector.close();
|
||||
const inspectorUrl: string = inspector.url();
|
||||
const inspectorUrl: string | undefined = inspector.url();
|
||||
|
||||
const session = new inspector.Session();
|
||||
session.connect();
|
||||
|
||||
Vendored
+2
-2
@@ -2506,7 +2506,7 @@ declare module "inspector" {
|
||||
export function close(): void;
|
||||
|
||||
/**
|
||||
* Return the URL of the active inspector, or undefined if there is none.
|
||||
* Return the URL of the active inspector, or `undefined` if there is none.
|
||||
*/
|
||||
export function url(): string;
|
||||
export function url(): string | undefined;
|
||||
}
|
||||
|
||||
@@ -4041,7 +4041,7 @@ namespace inspector_tests {
|
||||
inspector.open(0, 'localhost');
|
||||
inspector.open(0, 'localhost', true);
|
||||
inspector.close();
|
||||
const inspectorUrl: string = inspector.url();
|
||||
const inspectorUrl: string | undefined = inspector.url();
|
||||
|
||||
const session = new inspector.Session();
|
||||
session.connect();
|
||||
|
||||
Vendored
+2
-2
@@ -2524,7 +2524,7 @@ declare module "inspector" {
|
||||
export function close(): void;
|
||||
|
||||
/**
|
||||
* Return the URL of the active inspector, or undefined if there is none.
|
||||
* Return the URL of the active inspector, or `undefined` if there is none.
|
||||
*/
|
||||
export function url(): string;
|
||||
export function url(): string | undefined;
|
||||
}
|
||||
|
||||
@@ -4106,7 +4106,7 @@ namespace inspector_tests {
|
||||
inspector.open(0, 'localhost');
|
||||
inspector.open(0, 'localhost', true);
|
||||
inspector.close();
|
||||
const inspectorUrl: string = inspector.url();
|
||||
const inspectorUrl: string | undefined = inspector.url();
|
||||
|
||||
const session = new inspector.Session();
|
||||
session.connect();
|
||||
|
||||
Reference in New Issue
Block a user