From a07e25afe125b8e75a5cb9910d6c25e6bb179c1d Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Sun, 5 Mar 2017 18:03:39 +0100 Subject: [PATCH] doc/tools: fix more type inconsistencies - fix a number of uppercase types - lowercase 'integer' - consistent formatting in crypto PR-URL: https://github.com/nodejs/node/pull/11697 Backport-PR-URL: https://github.com/nodejs/node/pull/13054 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Timothy Gu --- doc/api/assert.md | 2 +- doc/api/buffer.md | 290 +++++++++++++-------------------------- doc/api/child_process.md | 32 ++--- doc/api/cluster.md | 8 +- doc/api/crypto.md | 20 +-- doc/api/dns.md | 4 +- doc/api/errors.md | 18 +-- doc/api/globals.md | 4 +- doc/api/http.md | 8 +- doc/api/modules.md | 6 +- doc/api/os.md | 24 ++-- doc/api/path.md | 22 +-- doc/api/process.md | 42 +++--- doc/api/repl.md | 2 +- doc/api/stream.md | 8 +- doc/api/url.md | 2 +- tools/doc/type-parser.js | 9 +- 17 files changed, 201 insertions(+), 300 deletions(-) diff --git a/doc/api/assert.md b/doc/api/assert.md index 873f03e77553b2..e02829918c8b45 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -199,7 +199,7 @@ added: v0.1.21 * `actual` {any} * `expected` {any} * `message` {any} -* `operator` {String} +* `operator` {string} Throws an `AssertionError`. If `message` is falsy, the error message is set as the values of `actual` and `expected` separated by the provided `operator`. diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 87272b6d05842c..9674c2ba27daae 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -350,8 +350,8 @@ deprecated: v6.0.0 * `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a [`TypedArray`]. -* `byteOffset` {Integer} Index of first byte to expose. **Default:** `0` -* `length` {Integer} Number of bytes to expose. +* `byteOffset` {integer} Index of first byte to expose. **Default:** `0` +* `length` {integer} Number of bytes to expose. **Default:** `arrayBuffer.length - byteOffset` This creates a view of the [`ArrayBuffer`] without copying the underlying @@ -391,7 +391,7 @@ deprecated: v6.0.0 > Stability: 0 - Deprecated: Use [`Buffer.alloc()`] instead (also see > [`Buffer.allocUnsafe()`]). -* `size` {Integer} The desired length of the new `Buffer` +* `size` {integer} The desired length of the new `Buffer` Allocates a new `Buffer` of `size` bytes. The `size` must be less than or equal to the value of [`buffer.kMaxLength`]. Otherwise, a [`RangeError`] is thrown. @@ -453,8 +453,8 @@ console.log(buf2.toString()); added: v5.10.0 --> -* `size` {Integer} The desired length of the new `Buffer` -* `fill` {string | Buffer | Integer} A value to pre-fill the new `Buffer` with. +* `size` {integer} The desired length of the new `Buffer` +* `fill` {string|Buffer|integer} A value to pre-fill the new `Buffer` with. **Default:** `0` * `encoding` {string} If `fill` is a string, this is its encoding. **Default:** `'utf8'` @@ -510,7 +510,7 @@ A `TypeError` will be thrown if `size` is not a number. added: v5.10.0 --> -* `size` {Integer} The desired length of the new `Buffer` +* `size` {integer} The desired length of the new `Buffer` Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must be less than or equal to the value of [`buffer.kMaxLength`]. Otherwise, a @@ -556,7 +556,7 @@ additional performance that [`Buffer.allocUnsafe()`] provides. added: v5.10.0 --> -* `size` {Integer} The desired length of the new `Buffer` +* `size` {integer} The desired length of the new `Buffer` Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The `size` must be less than or equal to the value of [`buffer.kMaxLength`]. @@ -609,11 +609,11 @@ A `TypeError` will be thrown if `size` is not a number. added: v0.1.90 --> -* `string` {string | Buffer | TypedArray | DataView | ArrayBuffer} A value to +* `string` {string|Buffer|TypedArray|DataView|ArrayBuffer} A value to calculate the length of * `encoding` {string} If `string` is a string, this is its encoding. **Default:** `'utf8'` -* Returns: {Integer} The number of bytes contained within `string` +* Returns: {integer} The number of bytes contained within `string` Returns the actual byte length of a string. This is not the same as [`String.prototype.length`] since that returns the number of *characters* in @@ -729,8 +729,8 @@ added: v5.10.0 * `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a [`TypedArray`]. -* `byteOffset` {Integer} Index of first byte to expose. **Default:** `0` -* `length` {Integer} Number of bytes to expose. +* `byteOffset` {integer} Index of first byte to expose. **Default:** `0` +* `length` {integer} Number of bytes to expose. **Default:** `arrayBuffer.length - byteOffset` This creates a view of the [`ArrayBuffer`] without copying the underlying @@ -837,7 +837,7 @@ added: v0.1.101 --> * `obj` {Object} -* Returns: {Boolean} +* Returns: {boolean} Returns `true` if `obj` is a `Buffer`, `false` otherwise. @@ -847,7 +847,7 @@ added: v0.9.1 --> * `encoding` {string} A character encoding name to check -* Returns: {Boolean} +* Returns: {boolean} Returns `true` if `encoding` contains a supported character encoding, or `false` otherwise. @@ -857,7 +857,7 @@ otherwise. added: v0.11.3 --> -* {Integer} **Default:** `8192` +* {integer} **Default:** `8192` This is the number of bytes used to determine the size of pre-allocated, internal `Buffer` instances used for pooling. This value may be modified. @@ -898,15 +898,15 @@ added: v0.11.13 * `target` {Buffer} A `Buffer` to compare to * `targetStart` {Integer} The offset within `target` at which to begin comparison. **Default:** `0` -* `targetEnd` {Integer} The offset with `target` at which to end comparison +* `targetEnd` {integer} The offset with `target` at which to end comparison (not inclusive). Ignored when `targetStart` is `undefined`. **Default:** `target.length` -* `sourceStart` {Integer} The offset within `buf` at which to begin comparison. +* `sourceStart` {integer} The offset within `buf` at which to begin comparison. Ignored when `targetStart` is `undefined`. **Default:** `0` -* `sourceEnd` {Integer} The offset within `buf` at which to end comparison +* `sourceEnd` {integer} The offset within `buf` at which to end comparison (not inclusive). Ignored when `targetStart` is `undefined`. **Default:** [`buf.length`] -* Returns: {Integer} +* Returns: {integer} Compares `buf` with `target` and returns a number indicating whether `buf` comes before, after, or is the same as `target` in sort order. @@ -972,13 +972,13 @@ added: v0.1.90 --> * `target` {Buffer|Uint8Array} A `Buffer` or [`Uint8Array`] to copy into. -* `targetStart` {Integer} The offset within `target` at which to begin +* `targetStart` {integer} The offset within `target` at which to begin copying to. **Default:** `0` -* `sourceStart` {Integer} The offset within `buf` at which to begin copying from. +* `sourceStart` {integer} The offset within `buf` at which to begin copying from. Ignored when `targetStart` is `undefined`. **Default:** `0` -* `sourceEnd` {Integer} The offset within `buf` at which to stop copying (not +* `sourceEnd` {integer} The offset within `buf` at which to stop copying (not inclusive). Ignored when `sourceStart` is `undefined`. **Default:** [`buf.length`] -* Returns: {Integer} The number of bytes copied. +* Returns: {integer} The number of bytes copied. Copies data from a region of `buf` to a region in `target` even if the `target` memory region overlaps with `buf`. @@ -1051,7 +1051,7 @@ added: v0.11.13 --> * `otherBuffer` {Buffer} A `Buffer` to compare to -* Returns: {Boolean} +* Returns: {boolean} Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes, `false` otherwise. @@ -1075,9 +1075,9 @@ console.log(buf1.equals(buf3)); added: v0.5.0 --> -* `value` {string | Buffer | Integer} The value to fill `buf` with -* `offset` {Integer} Where to start filling `buf`. **Default:** `0` -* `end` {Integer} Where to stop filling `buf` (not inclusive). **Default:** [`buf.length`] +* `value` {string|Buffer|integer} The value to fill `buf` with +* `offset` {integer} Where to start filling `buf`. **Default:** `0` +* `end` {integer} Where to stop filling `buf` (not inclusive). **Default:** [`buf.length`] * `encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'` * Returns: {Buffer} A reference to `buf` @@ -1107,50 +1107,6 @@ Example: Fill a `Buffer` with a two-byte character console.log(Buffer.allocUnsafe(3).fill('\u0222')); ``` -<<<<<<< HEAD -||||||| parent of ff1361957d... doc: consistent case for primitive types -### buf.includes(value[, byteOffset][, encoding]) - - -* `value` {String | Buffer | Integer} What to search for -* `byteOffset` {Integer} Where to begin searching in `buf`. **Default:** `0` -* `encoding` {String} If `value` is a string, this is its encoding. - **Default:** `'utf8'` -* Returns: {Boolean} `true` if `value` was found in `buf`, `false` otherwise - -Equivalent to [`buf.indexOf() !== -1`][`buf.indexOf()`]. - -Examples: - -```js -const buf = Buffer.from('this is a buffer'); - -// Prints: true -console.log(buf.includes('this')); - -// Prints: true -console.log(buf.includes('is')); - -// Prints: true -console.log(buf.includes(Buffer.from('a buffer'))); - -// Prints: true -// (97 is the decimal ASCII value for 'a') -console.log(buf.includes(97)); - -// Prints: false -console.log(buf.includes(Buffer.from('a buffer example'))); - -// Prints: true -console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - -// Prints: false -console.log(buf.includes('this', 4)); -``` - -======= ### buf.includes(value[, byteOffset][, encoding]) -<<<<<<< HEAD -* `value` {String | Buffer | Integer} What to search for -||||||| parent of ff1361957d... doc: consistent case for primitive types -* `value` {String | Buffer | Uint8Array | Integer} What to search for -======= -* `value` {string | Buffer | Uint8Array | Integer} What to search for ->>>>>>> ff1361957d... doc: consistent case for primitive types +* `value` {string | Buffer | Integer} What to search for * `byteOffset` {Integer} Where to begin searching in `buf`. **Default:** `0` * `encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'` -* Returns: {Integer} The index of the first occurrence of `value` in `buf` or `-1` +* Returns: {integer} The index of the first occurrence of `value` in `buf` or `-1` if `buf` does not contain `value` If `value` is: @@ -1350,18 +1299,12 @@ for (const key of buf.keys()) { added: v6.0.0 --> -<<<<<<< HEAD -* `value` {String | Buffer | Integer} What to search for -||||||| parent of ff1361957d... doc: consistent case for primitive types -* `value` {String | Buffer | Uint8Array | Integer} What to search for -======= -* `value` {string | Buffer | Uint8Array | Integer} What to search for ->>>>>>> ff1361957d... doc: consistent case for primitive types +* `value` {string | Buffer | Integer} What to search for * `byteOffset` {Integer} Where to begin searching in `buf`. **Default:** [`buf.length`]` - 1` * `encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'` -* Returns: {Integer} The index of the last occurrence of `value` in `buf` or `-1` +* Returns: {integer} The index of the last occurrence of `value` in `buf` or `-1` if `buf` does not contain `value` Identical to [`buf.indexOf()`], except `buf` is searched from back to front @@ -1436,7 +1379,7 @@ console.log(b.lastIndexOf('b', [])); added: v0.1.90 --> -* {Integer} +* {integer} Returns the amount of memory allocated for `buf` in bytes. Note that this does not necessarily reflect the amount of "usable" data within `buf`. @@ -1482,9 +1425,9 @@ console.log(buf.length); added: v0.11.15 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 8` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 8` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Number} +* Returns: {number} Reads a 64-bit double from `buf` at the specified `offset` with specified endian format (`readDoubleBE()` returns big endian, `readDoubleLE()` returns @@ -1518,9 +1461,9 @@ console.log(buf.readDoubleLE(1, true)); added: v0.11.15 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Number} +* Returns: {number} Reads a 32-bit float from `buf` at the specified `offset` with specified endian format (`readFloatBE()` returns big endian, `readFloatLE()` returns @@ -1553,9 +1496,9 @@ console.log(buf.readFloatLE(1, true)); added: v0.5.0 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads a signed 8-bit integer from `buf` at the specified `offset`. @@ -1585,9 +1528,9 @@ console.log(buf.readInt8(2)); added: v0.5.5 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads a signed 16-bit integer from `buf` at the specified `offset` with the specified endian format (`readInt16BE()` returns big endian, @@ -1619,9 +1562,9 @@ console.log(buf.readInt16LE(1)); added: v0.5.5 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads a signed 32-bit integer from `buf` at the specified `offset` with the specified endian format (`readInt32BE()` returns big endian, @@ -1653,10 +1596,10 @@ console.log(buf.readInt32LE(1)); added: v0.11.15 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` +* `byteLength` {integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` * `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a two's complement signed value. Supports up to 48 @@ -1685,9 +1628,9 @@ console.log(buf.readIntBE(1, 6).toString(16)); added: v0.5.0 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads an unsigned 8-bit integer from `buf` at the specified `offset`. @@ -1715,9 +1658,9 @@ console.log(buf.readUInt8(2)); added: v0.5.5 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads an unsigned 16-bit integer from `buf` at the specified `offset` with specified endian format (`readUInt16BE()` returns big endian, `readUInt16LE()` @@ -1753,9 +1696,9 @@ console.log(buf.readUInt16LE(2).toString(16)); added: v0.5.5 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4` * `noAssert` {boolean} Skip `offset` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads an unsigned 32-bit integer from `buf` at the specified `offset` with specified endian format (`readUInt32BE()` returns big endian, @@ -1785,10 +1728,10 @@ console.log(buf.readUInt32LE(1).toString(16)); added: v0.11.15 --> -* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` +* `offset` {integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength` +* `byteLength` {integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6` * `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false` -* Returns: {Integer} +* Returns: {integer} Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned integer. Supports up to 48 @@ -1817,8 +1760,8 @@ console.log(buf.readUIntBE(1, 6).toString(16)); added: v0.3.0 --> -* `start` {Integer} Where the new `Buffer` will start. **Default:** `0` -* `end` {Integer} Where the new `Buffer` will end (not inclusive). +* `start` {integer} Where the new `Buffer` will start. **Default:** `0` +* `end` {integer} Where the new `Buffer` will end (not inclusive). **Default:** [`buf.length`] * Returns: {Buffer} @@ -1970,10 +1913,10 @@ added: v0.1.90 --> * `encoding` {string} The character encoding to decode to. **Default:** `'utf8'` -* `start` {Integer} The byte offset to start decoding at. **Default:** `0` -* `end` {Integer} The byte offset to stop decoding at (not inclusive). +* `start` {integer} The byte offset to start decoding at. **Default:** `0` +* `end` {integer} The byte offset to stop decoding at (not inclusive). **Default:** [`buf.length`] -* Returns: {String} +* Returns: {string} Decodes `buf` to a string according to the specified character encoding in `encoding`. `start` and `end` may be passed to decode only a subset of `buf`. @@ -2080,10 +2023,10 @@ added: v0.1.90 --> * `string` {string} String to be written to `buf` -* `offset` {Integer} Where to start writing `string`. **Default:** `0` -* `length` {Integer} How many bytes to write. **Default:** `buf.length - offset` +* `offset` {integer} Where to start writing `string`. **Default:** `0` +* `length` {integer} How many bytes to write. **Default:** `buf.length - offset` * `encoding` {string} The character encoding of `string`. **Default:** `'utf8'` -* Returns: {Integer} Number of bytes written +* Returns: {integer} Number of bytes written Writes `string` to `buf` at `offset` according to the character encoding in `encoding`. The `length` parameter is the number of bytes to write. If `buf` did not contain @@ -2108,9 +2051,9 @@ added: v0.11.15 --> * `value` {number} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 8` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 8` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset` with specified endian format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little @@ -2143,9 +2086,9 @@ added: v0.11.15 --> * `value` {number} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset` with specified endian format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little @@ -2176,10 +2119,10 @@ console.log(buf); added: v0.5.0 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset`. `value` *should* be a valid signed 8-bit integer. Behavior is undefined when `value` is anything other than @@ -2208,10 +2151,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset` with specified endian format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little @@ -2241,10 +2184,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset` with specified endian format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little @@ -2274,12 +2217,12 @@ console.log(buf); added: v0.11.15 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` +* `byteLength` {integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` * `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `byteLength` bytes of `value` to `buf` at the specified `offset`. Supports up to 48 bits of accuracy. Behavior is undefined when `value` is @@ -2309,10 +2252,10 @@ console.log(buf); added: v0.5.0 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset`. `value` *should* be a valid unsigned 8-bit integer. Behavior is undefined when `value` is anything @@ -2341,10 +2284,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset` with specified endian format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little @@ -2378,10 +2321,10 @@ console.log(buf); added: v0.5.5 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4` * `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `value` to `buf` at the specified `offset` with specified endian format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little @@ -2413,12 +2356,12 @@ console.log(buf); added: v0.5.5 --> -* `value` {Integer} Number to be written to `buf` -* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` -* `byteLength` {Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` +* `value` {integer} Number to be written to `buf` +* `offset` {integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength` +* `byteLength` {integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6` * `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation? **Default:** `false` -* Returns: {Integer} `offset` plus the number of bytes written +* Returns: {integer} `offset` plus the number of bytes written Writes `byteLength` bytes of `value` to `buf` at the specified `offset`. Supports up to 48 bits of accuracy. Behavior is undefined when `value` is @@ -2448,7 +2391,7 @@ console.log(buf); added: v0.5.4 --> -* {Integer} **Default:** `50` +* {integer} **Default:** `50` Returns the maximum number of bytes that will be returned when `buf.inspect()` is called. This can be overridden by user modules. See @@ -2462,53 +2405,11 @@ Note that this is a property on the `buffer` module as returned by added: v3.0.0 --> -* {Integer} The largest size allowed for a single `Buffer` instance +* {integer} The largest size allowed for a single `Buffer` instance On 32-bit architectures, this value is `(2^30)-1` (~1GB). On 64-bit architectures, this value is `(2^31)-1` (~2GB). -<<<<<<< HEAD -||||||| parent of ff1361957d... doc: consistent case for primitive types -Note that this is a property on the `buffer` module returned by -`require('buffer')`, not on the `Buffer` global or a `Buffer` instance. - -## buffer.transcode(source, fromEnc, toEnc) - - -* `source` {Buffer|Uint8Array} A `Buffer` or `Uint8Array` instance -* `fromEnc` {String} The current encoding -* `toEnc` {String} To target encoding - -Re-encodes the given `Buffer` or `Uint8Array` instance from one character -encoding to another. Returns a new `Buffer` instance. - -Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if -conversion from `fromEnc` to `toEnc` is not permitted. - -The transcoding process will use substitution characters if a given byte -sequence cannot be adequately represented in the target encoding. For instance: - -```js -const buffer = require('buffer'); - -const newBuf = buffer.transcode(Buffer.from('€'), 'utf8', 'ascii'); -console.log(newBuf.toString('ascii')); -// Prints: '?' -``` - -Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced -with `?` in the transcoded `Buffer`. - -Note that this is a property on the `buffer` module returned by -`require('buffer')`, not on the `Buffer` global or a `Buffer` instance. - -======= Note that this is a property on the `buffer` module returned by `require('buffer')`, not on the `Buffer` global or a `Buffer` instance. @@ -2548,7 +2449,6 @@ with `?` in the transcoded `Buffer`. Note that this is a property on the `buffer` module returned by `require('buffer')`, not on the `Buffer` global or a `Buffer` instance. ->>>>>>> ff1361957d... doc: consistent case for primitive types ## Class: SlowBuffer -* {Boolean} Set to `false` after `child.disconnect()` is called +* {boolean} Set to `false` after `child.disconnect()` is called The `child.connected` property indicates whether it is still possible to send and receive messages from a child process. When `child.connected` is `false`, it @@ -884,7 +884,7 @@ setTimeout(() => { added: v0.1.90 --> -* {Number} Integer +* {number} Integer Returns the process identifier (PID) of the child process. @@ -907,7 +907,7 @@ added: v0.5.9 * `sendHandle` {Handle} * `options` {Object} * `callback` {Function} -* Returns: {Boolean} +* Returns: {boolean} When an IPC channel has been established between the parent and child ( i.e. when using [`child_process.fork()`][]), the `child.send()` method can be diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 850881d787bf14..bdf58e2b45f279 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -328,7 +328,7 @@ if (cluster.isMaster) { added: v6.0.0 --> -* {Boolean} +* {boolean} Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`. @@ -352,7 +352,7 @@ worker.kill(); added: v0.8.0 --> -* {Number} +* {number} Each new worker is given its own unique id, this id is stored in the `id`. @@ -672,7 +672,7 @@ This can only be called from the master process. added: v0.8.1 --> -* {Boolean} +* {boolean} True if the process is a master. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` is @@ -683,7 +683,7 @@ undefined, then `isMaster` is `true`. added: v0.6.0 --> -* {Boolean} +* {boolean} True if the process is not a master (it is the negation of `cluster.isMaster`). diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 17d273d115cea4..7b4a483b11e719 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -901,8 +901,8 @@ The `private_key` argument can be an object or a string. If `private_key` is a string, it is treated as a raw key with no passphrase. If `private_key` is an object, it is interpreted as a hash containing two properties: -* `key` : {String} - PEM encoded private key -* `passphrase` : {String} - passphrase for the private key +* `key`: {string} - PEM encoded private key +* `passphrase`: {string} - passphrase for the private key The `output_format` can specify one of `'latin1'`, `'hex'` or `'base64'`. If `output_format` is provided a string is returned; otherwise a [`Buffer`][] is @@ -1410,8 +1410,8 @@ treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. If `private_key` is an object, it is interpreted as a hash object with the keys: -* `key` : {String} - PEM encoded private key -* `passphrase` : {String} - Optional passphrase for the private key +* `key`: {string} - PEM encoded private key +* `passphrase`: {string} - Optional passphrase for the private key * `padding` : An optional padding value, one of the following: * `crypto.constants.RSA_NO_PADDING` * `crypto.constants.RSA_PKCS1_PADDING` @@ -1447,8 +1447,8 @@ treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. If `private_key` is an object, it is interpreted as a hash object with the keys: -* `key` : {String} - PEM encoded private key -* `passphrase` : {String} - Optional passphrase for the private key +* `key`: {string} - PEM encoded private key +* `passphrase`: {string} - Optional passphrase for the private key * `padding` : An optional padding value, one of the following: * `crypto.constants.RSA_NO_PADDING` * `crypto.constants.RSA_PKCS1_PADDING` @@ -1467,8 +1467,8 @@ treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. If `public_key` is an object, it is interpreted as a hash object with the keys: -* `key` : {String} - PEM encoded public key -* `passphrase` : {String} - Optional passphrase for the private key +* `key`: {string} - PEM encoded public key +* `passphrase`: {string} - Optional passphrase for the private key * `padding` : An optional padding value, one of the following: * `crypto.constants.RSA_NO_PADDING` * `crypto.constants.RSA_PKCS1_PADDING` @@ -1491,8 +1491,8 @@ treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. If `public_key` is an object, it is interpreted as a hash object with the keys: -* `key` : {String} - PEM encoded public key -* `passphrase` : {String} - Optional passphrase for the private key +* `key`: {string} - PEM encoded public key +* `passphrase`: {string} - Optional passphrase for the private key * `padding` : An optional padding value, one of the following: * `crypto.constants.RSA_NO_PADDING` * `crypto.constants.RSA_PKCS1_PADDING` diff --git a/doc/api/dns.md b/doc/api/dns.md index 5760ebb1af44cd..44ca98c5597665 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -76,13 +76,13 @@ Alternatively, `options` can be an object containing these properties: * `family` {number} - The record family. If present, must be the integer `4` or `6`. If not provided, both IP v4 and v6 addresses are accepted. -* `hints`: {Number} - If present, it should be one or more of the supported +* `hints`: {number} - If present, it should be one or more of the supported `getaddrinfo` flags. If `hints` is not provided, then no flags are passed to `getaddrinfo`. Multiple flags can be passed through `hints` by bitwise `OR`ing their values. See [supported `getaddrinfo` flags][] for more information on supported flags. -* `all`: {Boolean} - When `true`, the callback returns all resolved addresses +* `all`: {boolean} - When `true`, the callback returns all resolved addresses in an array, otherwise returns a single address. Defaults to `false`. All properties are optional. diff --git a/doc/api/errors.md b/doc/api/errors.md index 94c06541c64842..9fc884b5625951 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -244,7 +244,7 @@ new MyError().stack; ### Error.stackTraceLimit -* {Number} +* {number} The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or @@ -258,7 +258,7 @@ not capture any frames. ### error.message -* {String} +* {string} The `error.message` property is the string description of the error as set by calling `new Error(message)`. The `message` passed to the constructor will also appear in the first line of @@ -274,7 +274,7 @@ console.error(err.message); ### error.stack -* {String} +* {string} The `error.stack` property is a string describing the point in the code at which the `Error` was instantiated. @@ -450,14 +450,14 @@ added properties. #### error.code -* {String} +* {string} The `error.code` property is a string representing the error code, which is always `E` followed by a sequence of capital letters. #### error.errno -* {String | Number} +* {string|number} The `error.errno` property is a number or a string. The number is a **negative** value which corresponds to the error code defined in @@ -467,27 +467,27 @@ In case of a string, it is the same as `error.code`. #### error.syscall -* {String} +* {string} The `error.syscall` property is a string describing the [syscall][] that failed. #### error.path -* {String} +* {string} When present (e.g. in `fs` or `child_process`), the `error.path` property is a string containing a relevant invalid pathname. #### error.address -* {String} +* {string} When present (e.g. in `net` or `dgram`), the `error.address` property is a string describing the address to which the connection failed. #### error.port -* {Number} +* {number} When present (e.g. in `net` or `dgram`), the `error.port` property is a number representing the connection's port that is not available. diff --git a/doc/api/globals.md b/doc/api/globals.md index a60cd4cc226fb2..b0467cdacde3a5 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -27,7 +27,7 @@ added: v0.1.27 -* {String} +* {string} The directory name of the current module. This the same as the [`path.dirname()`][] of the [`__filename`][]. @@ -50,7 +50,7 @@ added: v0.0.1 -* {String} +* {string} The file name of the current module. This is the resolved absolute path of the current module file. diff --git a/doc/api/http.md b/doc/api/http.md index 3d7174e909fbdb..02b7aa5cc9e7e7 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -463,7 +463,7 @@ aborted, in milliseconds since 1 January 1970 00:00:00 UTC. added: v0.1.90 --> -* `data` {string | Buffer} +* `data` {string|Buffer} * `encoding` {string} * `callback` {Function} @@ -531,7 +531,7 @@ Returns `request`. added: v0.1.29 --> -* `chunk` {string | Buffer} +* `chunk` {string|Buffer} * `encoding` {string} * `callback` {Function} @@ -895,7 +895,7 @@ will result in a [`TypeError`][] being thrown. added: v0.1.90 --> -* `data` {string | Buffer} +* `data` {string|Buffer} * `encoding` {string} * `callback` {Function} @@ -1080,7 +1080,7 @@ status message which was sent out. added: v0.1.29 --> -* `chunk` {string | Buffer} +* `chunk` {string|Buffer} * `encoding` {string} * `callback` {Function} * Returns: {Boolean} diff --git a/doc/api/modules.md b/doc/api/modules.md index 4eca72dd210c55..9621c72ccee0e4 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -586,7 +586,7 @@ function require(/* ... */) { added: v0.1.16 --> -* {String} +* {string} The fully resolved filename to the module. @@ -595,7 +595,7 @@ The fully resolved filename to the module. added: v0.1.16 --> -* {String} +* {string} The identifier for the module. Typically this is the fully resolved filename. @@ -605,7 +605,7 @@ filename. added: v0.1.16 --> -* {Boolean} +* {boolean} Whether or not the module is done loading, or is in the process of loading. diff --git a/doc/api/os.md b/doc/api/os.md index 318ea8d76cda3a..d14cd1b770e3db 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -14,7 +14,7 @@ const os = require('os'); added: v0.7.8 --> -* {String} +* {string} A string constant defining the operating system-specific end-of-line marker: @@ -26,7 +26,7 @@ A string constant defining the operating system-specific end-of-line marker: added: v0.5.0 --> -* Returns: {String} +* Returns: {string} The `os.arch()` method returns a string identifying the operating system CPU architecture *for which the Node.js binary was compiled*. @@ -172,7 +172,7 @@ all processors are always 0. added: v0.9.4 --> -* Returns: {String} +* Returns: {string} The `os.endianness()` method returns a string identifying the endianness of the CPU *for which the Node.js binary was compiled*. @@ -187,7 +187,7 @@ Possible values are: added: v0.3.3 --> -* Returns: {Integer} +* Returns: {integer} The `os.freemem()` method returns the amount of free system memory in bytes as an integer. @@ -197,7 +197,7 @@ an integer. added: v2.3.0 --> -* Returns: {String} +* Returns: {string} The `os.homedir()` method returns the home directory of the current user as a string. @@ -207,7 +207,7 @@ string. added: v0.3.3 --> -* Returns: {String} +* Returns: {string} The `os.hostname()` method returns the hostname of the operating system as a string. @@ -295,7 +295,7 @@ The properties available on the assigned network address object include: added: v0.5.0 --> -* Returns: {String} +* Returns: {string} The `os.platform()` method returns a string identifying the operating system platform as set during compile time of Node.js. @@ -321,7 +321,7 @@ to be experimental at this time. added: v0.3.3 --> -* Returns: {String} +* Returns: {string} The `os.release()` method returns a string identifying the operating system release. @@ -335,7 +335,7 @@ https://en.wikipedia.org/wiki/Uname#Examples for more information. added: v0.9.9 --> -* Returns: {String} +* Returns: {string} The `os.tmpdir()` method returns a string specifying the operating system's default directory for temporary files. @@ -345,7 +345,7 @@ default directory for temporary files. added: v0.3.3 --> -* Returns: {Integer} +* Returns: {integer} The `os.totalmem()` method returns the total amount of system memory in bytes as an integer. @@ -355,7 +355,7 @@ as an integer. added: v0.3.3 --> -* Returns: {String} +* Returns: {string} The `os.type()` method returns a string identifying the operating system name as returned by uname(3). For example `'Linux'` on Linux, `'Darwin'` on macOS and @@ -369,7 +369,7 @@ information about the output of running uname(3) on various operating systems. added: v0.3.3 --> -* Returns: {Integer} +* Returns: {integer} The `os.uptime()` method returns the system uptime in number of seconds. diff --git a/doc/api/path.md b/doc/api/path.md index c8fdff46a76d5f..a44bacb4657c10 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -61,7 +61,7 @@ added: v0.1.25 * `path` {string} * `ext` {string} An optional file extension -* Returns: {String} +* Returns: {string} The `path.basename()` methods returns the last portion of a `path`, similar to the Unix `basename` command. Trailing directory separators are ignored, see @@ -85,7 +85,7 @@ and is not a string. added: v0.9.3 --> -* {String} +* {string} Provides the platform-specific path delimiter: @@ -118,7 +118,7 @@ added: v0.1.16 --> * `path` {string} -* Returns: {String} +* Returns: {string} The `path.dirname()` method returns the directory name of a `path`, similar to the Unix `dirname` command. Trailing directory separators are ignored, see @@ -139,7 +139,7 @@ added: v0.1.25 --> * `path` {string} -* Returns: {String} +* Returns: {string} The `path.extname()` method returns the extension of the `path`, from the last occurrence of the `.` (period) character to end of string in the last portion of @@ -179,7 +179,7 @@ added: v0.11.15 * `base` {string} * `name` {string} * `ext` {string} -* Returns: {String} +* Returns: {string} The `path.format()` method returns a path string from an object. This is the opposite of [`path.parse()`][]. @@ -238,7 +238,7 @@ added: v0.11.2 --> * `path` {string} -* Returns: {Boolean} +* Returns: {boolean} The `path.isAbsolute()` method determines if `path` is an absolute path. @@ -273,7 +273,7 @@ added: v0.1.16 --> * `...paths` {string} A sequence of path segments -* Returns: {String} +* Returns: {string} The `path.join()` method joins all given `path` segments together using the platform specific separator as a delimiter, then normalizes the resulting path. @@ -300,7 +300,7 @@ added: v0.1.23 --> * `path` {string} -* Returns: {String} +* Returns: {string} The `path.normalize()` method normalizes the given `path`, resolving `'..'` and `'.'` segments. @@ -415,7 +415,7 @@ added: v0.5.0 * `from` {string} * `to` {string} -* Returns: {String} +* Returns: {string} The `path.relative()` method returns the relative path from `from` to `to`. If `from` and `to` each resolve to the same path (after calling `path.resolve()` @@ -446,7 +446,7 @@ added: v0.3.4 --> * `...paths` {string} A sequence of paths or path segments -* Returns: {String} +* Returns: {string} The `path.resolve()` method resolves a sequence of paths or path segments into an absolute path. @@ -488,7 +488,7 @@ A [`TypeError`][] is thrown if any of the arguments is not a string. added: v0.7.9 --> -* {String} +* {string} Provides the platform-specific path segment separator: diff --git a/doc/api/process.md b/doc/api/process.md index 6a1a779ddddf9d..70156972cb90b1 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -447,7 +447,7 @@ generate a core file. added: v0.5.0 --> -* {String} +* {string} The `process.arch` property returns a String identifying the processor architecture that the Node.js process is currently running on. For instance @@ -501,7 +501,7 @@ Would generate the output: added: 6.4.0 --> -* {String} +* {string} The `process.argv0` property stores a read-only copy of the original value of `argv[0]` passed when Node.js starts. @@ -586,7 +586,7 @@ replace the value of `process.config`. added: v0.7.2 --> -* {Boolean} +* {boolean} If the Node.js process is spawned with an IPC channel (see the [Child Process][] and [Cluster][] documentation), the `process.connected` property will return @@ -604,8 +604,8 @@ added: v6.1.0 * `previousValue` {Object} A previous return value from calling `process.cpuUsage()` * Returns: {Object} - * `user` {Integer} - * `system` {Integer} + * `user` {integer} + * `system` {integer} The `process.cpuUsage()` method returns the user and system CPU time usage of the current process, in an object with properties `user` and `system`, whose @@ -633,7 +633,7 @@ console.log(process.cpuUsage(startUsage)); added: v0.1.8 --> -* Returns: {String} +* Returns: {string} The `process.cwd()` method returns the current working directory of the Node.js process. @@ -861,7 +861,7 @@ And `process.argv`: added: v0.1.100 --> -* {String} +* {string} The `process.execPath` property returns the absolute pathname of the executable that started the Node.js process. @@ -878,7 +878,7 @@ For example: added: v0.1.13 --> -* `code` {Integer} The exit code. Defaults to `0`. +* `code` {integer} The exit code. Defaults to `0`. The `process.exit()` method instructs Node.js to terminate the process synchronously with an exit status of `code`. If `code` is omitted, exit uses @@ -943,7 +943,7 @@ is safer than calling `process.exit()`. added: v0.11.8 --> -* {Integer} +* {integer} A number which will be the process exit code, when the process either exits gracefully, or is exited via [`process.exit()`][] without specifying @@ -1028,7 +1028,7 @@ Android) added: v0.1.28 --> -* Returns: {Integer} +* Returns: {integer} The `process.getuid()` method returns the numeric user identity of the process. (See getuid(2).) @@ -1163,10 +1163,10 @@ added: v0.1.16 --> * Returns: {Object} - * `rss` {Integer} - * `heapTotal` {Integer} - * `heapUsed` {Integer} - * `external` {Integer} + * `rss` {integer} + * `heapTotal` {integer} + * `heapUsed` {integer} + * `external` {integer} The `process.memoryUsage()` method returns an object describing the memory usage of the Node.js process measured in bytes. @@ -1291,7 +1291,7 @@ happening, just like a `while(true);` loop. added: v0.1.15 --> -* {Integer} +* {integer} The `process.pid` property returns the PID of the process. @@ -1304,7 +1304,7 @@ console.log(`This process is pid ${process.pid}`); added: v0.1.16 --> -* {String} +* {string} The `process.platform` property returns a string identifying the operating system platform on which the Node.js process is running. For instance @@ -1335,7 +1335,7 @@ tarball. - `"Boron"` for the v6.x LTS line beginning with v6.9.0. * `sourceUrl` {string} an absolute URL pointing to a _`.tar.gz`_ file containing the source code of the current release. -* `headersUrl`{String} an absolute URL pointing to a _`.tar.gz`_ file containing +* `headersUrl`{string} an absolute URL pointing to a _`.tar.gz`_ file containing only the source header files for the current release. This file is significantly smaller than the full source file and can be used for compiling Node.js native add-ons. @@ -1371,7 +1371,7 @@ added: v0.5.9 * `sendHandle` {Handle object} * `options` {Object} * `callback` {Function} -* Returns: {Boolean} +* Returns: {boolean} If Node.js is spawned with an IPC channel, the `process.send()` method can be used to send messages to the parent process. Messages will be received as a @@ -1629,7 +1629,7 @@ See the [TTY][] documentation for more information. added: v0.1.104 --> -* {String} +* {string} The `process.title` property returns the current process title (i.e. returns the current value of `ps`). Assigning a new value to `process.title` modifies @@ -1670,7 +1670,7 @@ console.log( added: v0.5.0 --> -* Returns: {Number} +* Returns: {number} The `process.uptime()` method returns the number of seconds the current Node.js process has been running. @@ -1680,7 +1680,7 @@ process has been running. added: v0.1.3 --> -* {String} +* {string} The `process.version` property returns the Node.js version string. diff --git a/doc/api/repl.md b/doc/api/repl.md index 27b5b9aa392ab2..248d87991bb8ff 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -371,7 +371,7 @@ within the action function for commands registered using the added: v0.1.91 --> -* `options` {Object | String} +* `options` {Object | string} * `prompt` {string} The input prompt to display. Defaults to `> `. * `input` {Readable} The Readable stream from which REPL input will be read. Defaults to `process.stdin`. diff --git a/doc/api/stream.md b/doc/api/stream.md index e74cb327ce0239..6464d453840d13 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -434,7 +434,7 @@ added: v0.9.4 * `chunk` {string|Buffer} The data to write * `encoding` {string} The encoding, if `chunk` is a String * `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} `false` if the stream wishes for the calling code to +* Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. @@ -732,7 +732,7 @@ preferred over the use of the `'readable'` event. added: v0.11.14 --> -* Returns: {Boolean} +* Returns: {boolean} The `readable.isPaused()` method returns the current operating state of the Readable. This is used primarily by the mechanism that underlies the @@ -837,7 +837,7 @@ added: v0.9.4 --> * `size` {number} Optional argument to specify how much data to read. -* Return {String|Buffer|null} +* Return {string|Buffer|null} The `readable.read()` method pulls some data out of the internal buffer and returns it. If no data available to be read, `null` is returned. By default, @@ -1486,7 +1486,7 @@ user programs. * `chunk` {Buffer|null|string} Chunk of data to push into the read queue * `encoding` {string} Encoding of String chunks. Must be a valid Buffer encoding, such as `'utf8'` or `'ascii'` -* Returns {Boolean} `true` if additional chunks of data may continued to be +* Returns {boolean} `true` if additional chunks of data may continued to be pushed; `false` otherwise. When `chunk` is a `Buffer` or `string`, the `chunk` of data will be added to the diff --git a/doc/api/url.md b/doc/api/url.md index 9c8783d7ed3f0f..04957882e23ec9 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -136,7 +136,7 @@ For example: `'#hash'` added: v0.1.25 --> -* `urlObject` {Object | string} A URL object (as returned by `url.parse()` or +* `urlObject` {Object|string} A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 96fdaf16e99461..3f1ea9597c4fbe 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -5,12 +5,13 @@ const jsDocUrl = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/' + const jsPrimitiveUrl = 'https://developer.mozilla.org/en-US/docs/Web/' + 'JavaScript/Data_structures'; const jsPrimitives = { - 'integer': 'Number', // this is for extending - 'number': 'Number', - 'string': 'String', 'boolean': 'Boolean', + 'integer': 'Number', // not a primitive, used for clarification 'null': 'Null', - 'symbol': 'Symbol' + 'number': 'Number', + 'string': 'String', + 'symbol': 'Symbol', + 'undefined': 'Undefined' }; const jsGlobalTypes = [ 'Error', 'Object', 'Function', 'Array', 'TypedArray', 'Uint8Array',