Skip to content

Commit 62dbd36

Browse files
y-hsgwtargos
authored andcommitted
doc: update return types for eventNames method in EventEmitter
PR-URL: #58083 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
1 parent 8f1aee9 commit 62dbd36

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/api/events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
603603
added: v6.0.0
604604
-->
605605

606-
* Returns: {Array}
606+
* Returns: {string\[]|symbol\[]}
607607

608608
Returns an array listing the events for which the emitter has registered
609-
listeners. The values in the array are strings or `Symbol`s.
609+
listeners.
610610

611611
```mjs
612612
import { EventEmitter } from 'node:events';

lib/events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ function listenerCount(type, listener) {
871871
/**
872872
* Returns an array listing the events for which
873873
* the emitter has registered listeners.
874-
* @returns {any[]}
874+
* @returns {(string | symbol)[]}
875875
*/
876876
EventEmitter.prototype.eventNames = function eventNames() {
877877
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];

0 commit comments

Comments
 (0)