From 1fa59b4c7e575ca70fee802e4cbb599fdb59df04 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sat, 16 Dec 2017 18:33:31 +0100 Subject: [PATCH 1/2] doc: remove extra whitespace in module docs PR-URL: https://github.com/nodejs/node/pull/17711 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Vse Mozhet Byt --- doc/api/modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index bf3af6373d5..16c01f66fa4 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -838,7 +838,7 @@ added: v9.3.0 * {string[]} -A list of the names of all modules provided by Node.js. Can be used to verify +A list of the names of all modules provided by Node.js. Can be used to verify if a module is maintained by a third-party module or not. [`__dirname`]: #modules_dirname From b2432a7f00fc2e9bd05e97c242871999b983d4f5 Mon Sep 17 00:00:00 2001 From: April Webster Date: Wed, 13 Dec 2017 14:40:12 -0800 Subject: [PATCH 2/2] doc: change eventName type annotations Change type annotations for eventName in events API doc from {any} to {string|symbol}. PR-URL: https://github.com/nodejs/node/pull/17666 Fixes: https://github.com/nodejs/node/issues/17657 Reviewed-By: Anna Henningsen Reviewed-By: Jon Moss Reviewed-By: Timothy Gu Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Evan Lucas Reviewed-By: Luigi Pinca Reviewed-By: Anatoli Papirovski Reviewed-By: Ruben Bridgewater --- doc/api/events.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index c935b7de0f7..d0bf2c1897a 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -175,7 +175,7 @@ added and `'removeListener'` when existing listeners are removed. added: v0.1.26 --> -* `eventName` {any} The name of the event being listened for +* `eventName` {string|symbol} The name of the event being listened for * `listener` {Function} The event handler function The `EventEmitter` instance will emit its own `'newListener'` event *before* @@ -219,7 +219,7 @@ changes: now yields the original listener function. --> -* `eventName` {any} The event name +* `eventName` {string|symbol} The event name * `listener` {Function} The event handler function The `'removeListener'` event is emitted *after* the `listener` is removed. @@ -287,7 +287,7 @@ Its `name` property is set to `'MaxListenersExceededWarning'`. -- `eventName` {any} +- `eventName` {string|symbol} - `listener` {Function} Alias for `emitter.on(eventName, listener)`. @@ -296,7 +296,7 @@ Alias for `emitter.on(eventName, listener)`. -- `eventName` {any} +- `eventName` {string|symbol} - `...args` {any} Synchronously calls each of the listeners registered for the event named @@ -340,7 +340,7 @@ set by [`emitter.setMaxListeners(n)`][] or defaults to added: v3.2.0 --> -* `eventName` {any} The name of the event being listened for +* `eventName` {string|symbol} The name of the event being listened for Returns the number of listeners listening to the event named `eventName`. @@ -353,7 +353,7 @@ changes: description: For listeners attached using `.once()` this returns the original listeners instead of wrapper functions now. --> -- `eventName` {any} +- `eventName` {string|symbol} Returns a copy of the array of listeners for the event named `eventName`. @@ -370,7 +370,7 @@ console.log(util.inspect(server.listeners('connection'))); added: v0.1.101 --> -* `eventName` {any} The name of the event. +* `eventName` {string|symbol} The name of the event. * `listener` {Function} The callback function Adds the `listener` function to the end of the listeners array for the @@ -406,7 +406,7 @@ myEE.emit('foo'); added: v0.3.0 --> -* `eventName` {any} The name of the event. +* `eventName` {string|symbol} The name of the event. * `listener` {Function} The callback function Adds a **one-time** `listener` function for the event named `eventName`. The @@ -439,7 +439,7 @@ myEE.emit('foo'); added: v6.0.0 --> -* `eventName` {any} The name of the event. +* `eventName` {string|symbol} The name of the event. * `listener` {Function} The callback function Adds the `listener` function to the *beginning* of the listeners array for the @@ -461,7 +461,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. added: v6.0.0 --> -* `eventName` {any} The name of the event. +* `eventName` {string|symbol} The name of the event. * `listener` {Function} The callback function Adds a **one-time** `listener` function for the event named `eventName` to the @@ -480,7 +480,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. -- `eventName` {any} +- `eventName` {string|symbol} Removes all listeners, or those of the specified `eventName`. @@ -494,7 +494,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. -- `eventName` {any} +- `eventName` {string|symbol} - `listener` {Function} Removes the specified `listener` from the listener array for the event named @@ -578,7 +578,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. -- `eventName` {any} +- `eventName` {string|symbol} Returns a copy of the array of listeners for the event named `eventName`, including any wrappers (such as those created by `.once`).