forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(node): correct order of params for diagnostics listeners (Definit…
…elyTyped#59796) as per documentation and source code: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/diagnostics_channel.js#L54 Thanks!
- Loading branch information
1 parent
7834070
commit 7b3903d
Showing
4 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { Channel, channel, hasSubscribers } from 'node:diagnostics_channel'; | ||
|
||
const ch1: Channel = channel('test'); | ||
function listener(name: string, data: unknown) { | ||
} | ||
function listener(data: unknown) {} | ||
function anotherListener(data: unknown, name: string) {} | ||
|
||
const active: boolean = ch1.hasSubscribers; | ||
const name: string = ch1.name; | ||
|
||
ch1.subscribe(listener); | ||
ch1.subscribe(anotherListener); | ||
|
||
ch1.unsubscribe(listener); | ||
ch1.unsubscribe(anotherListener); | ||
|
||
const hasSubs = hasSubscribers('test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { Channel, channel, hasSubscribers } from 'node:diagnostics_channel'; | ||
|
||
const ch1: Channel = channel('test'); | ||
function listener(name: string, data: unknown) { | ||
} | ||
function listener(data: unknown) {} | ||
function anotherListener(data: unknown, name: string) {} | ||
|
||
const active: boolean = ch1.hasSubscribers; | ||
const name: string = ch1.name; | ||
|
||
ch1.subscribe(listener); | ||
ch1.subscribe(anotherListener); | ||
|
||
ch1.unsubscribe(listener); | ||
ch1.unsubscribe(anotherListener); | ||
|
||
const hasSubs = hasSubscribers('test'); |