Skip to content

Commit

Permalink
doc/tools: fix more type inconsistencies
Browse files Browse the repository at this point in the history
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: #11697
Backport-PR-URL: #13054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
  • Loading branch information
silverwind authored and gibfahn committed Jun 20, 2017
1 parent c881b2c commit 281191f
Show file tree
Hide file tree
Showing 18 changed files with 389 additions and 379 deletions.
2 changes: 1 addition & 1 deletion doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
204 changes: 102 additions & 102 deletions doc/api/buffer.md

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ added: v0.1.90
understand the `-c` switch on UNIX or `/s /c` on Windows. On Windows,
command line parsing should be compatible with `cmd.exe`.)
* `timeout` {number} (Default: `0`)
* [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on
* [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on
stdout or stderr - if exceeded child process is killed (Default: `200*1024`)
* `killSignal` {string|Integer} (Default: `'SIGTERM'`)
* `killSignal` {string|integer} (Default: `'SIGTERM'`)
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `callback` {Function} called with the output when process terminates
Expand Down Expand Up @@ -212,9 +212,9 @@ added: v0.1.91
* `env` {Object} Environment key-value pairs
* `encoding` {string} (Default: `'utf8'`)
* `timeout` {number} (Default: `0`)
* [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on
* [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on
stdout or stderr - if exceeded child process is killed (Default: `200*1024`)
* `killSignal` {string|Integer} (Default: `'SIGTERM'`)
* `killSignal` {string|integer} (Default: `'SIGTERM'`)
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `callback` {Function} called with the output when process terminates
Expand Down Expand Up @@ -583,17 +583,17 @@ added: v0.11.12
* `input` {string|Buffer} The value which will be passed as stdin to the
spawned process
- supplying this value will override `stdio[0]`
* `stdio` {string | Array} Child's stdio configuration. (Default: `'pipe'`)
* `stdio` {string|Array} Child's stdio configuration. (Default: `'pipe'`)
- `stderr` by default will be output to the parent process' stderr unless
`stdio` is specified
* `env` {Object} Environment key-value pairs
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `timeout` {number} In milliseconds the maximum amount of time the process
is allowed to run. (Default: `undefined`)
* `killSignal` {string|Integer} The signal value to be used when the spawned
* `killSignal` {string|integer} The signal value to be used when the spawned
process will be killed. (Default: `'SIGTERM'`)
* [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on
* [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on
stdout or stderr - if exceeded child process is killed
* `encoding` {string} The encoding used for all stdio inputs and outputs. (Default: `'buffer'`)
* Returns: {Buffer|string} The stdout from the command
Expand Down Expand Up @@ -621,7 +621,7 @@ added: v0.11.12
* `input` {string|Buffer} The value which will be passed as stdin to the
spawned process
- supplying this value will override `stdio[0]`
* `stdio` {string | Array} Child's stdio configuration. (Default: `'pipe'`)
* `stdio` {string|Array} Child's stdio configuration. (Default: `'pipe'`)
- `stderr` by default will be output to the parent process' stderr unless
`stdio` is specified
* `env` {Object} Environment key-value pairs
Expand All @@ -633,9 +633,9 @@ added: v0.11.12
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `timeout` {number} In milliseconds the maximum amount of time the process
is allowed to run. (Default: `undefined`)
* `killSignal` {string|Integer} The signal value to be used when the spawned
* `killSignal` {string|integer} The signal value to be used when the spawned
process will be killed. (Default: `'SIGTERM'`)
* [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on
* [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on
stdout or stderr - if exceeded child process is killed
* `encoding` {string} The encoding used for all stdio inputs and outputs.
(Default: `'buffer'`)
Expand Down Expand Up @@ -669,15 +669,15 @@ added: v0.11.12
* `input` {string|Buffer} The value which will be passed as stdin to the
spawned process
- supplying this value will override `stdio[0]`
* `stdio` {string | Array} Child's stdio configuration.
* `stdio` {string|Array} Child's stdio configuration.
* `env` {Object} Environment key-value pairs
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `timeout` {number} In milliseconds the maximum amount of time the process
is allowed to run. (Default: `undefined`)
* `killSignal` {string|Integer} The signal value to be used when the spawned
* `killSignal` {string|integer} The signal value to be used when the spawned
process will be killed. (Default: `'SIGTERM'`)
* [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on
* [`maxBuffer`][] {number} largest amount of data (in bytes) allowed on
stdout or stderr - if exceeded child process is killed
* `encoding` {string} The encoding used for all stdio inputs and outputs.
(Default: `'buffer'`)
Expand Down Expand Up @@ -797,7 +797,7 @@ to send messages.
added: v0.7.2
-->

* {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
Expand Down Expand Up @@ -884,7 +884,7 @@ setTimeout(() => {
added: v0.1.90
-->

* {Number} Integer
* {number} Integer

Returns the process identifier (PID) of the child process.

Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ if (cluster.isMaster) {
added: v6.0.0
-->

* {Boolean}
* {boolean}

Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`.

Expand All @@ -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`.
Expand Down Expand Up @@ -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
Expand All @@ -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`).

Expand Down
7 changes: 7 additions & 0 deletions doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ console.log('this will also print');
<!-- YAML
added: v0.1.101
-->
* `obj` {any}
* `options` {Object}
* `showHidden` {boolean}
* `depth` {number}
* `colors` {boolean}

Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`.
This function bypasses any custom `inspect()` function defined on `obj`. An
Expand Down Expand Up @@ -227,6 +232,7 @@ values are concatenated. See [`util.format()`][] for more information.
<!-- YAML
added: v0.1.104
-->
* `label` {string}

Starts a timer that can be used to compute the duration of an operation. Timers
are identified by a unique `label`. Use the same `label` when you call
Expand All @@ -237,6 +243,7 @@ milliseconds to `stdout`. Timer durations are accurate to the sub-millisecond.
<!-- YAML
added: v0.1.104
-->
* `label` {string}

Stops a timer that was previously started by calling [`console.time()`][] and
prints the result to `stdout`:
Expand Down
20 changes: 10 additions & 10 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 9 additions & 9 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
Loading

0 comments on commit 281191f

Please sign in to comment.