Skip to content

Commit

Permalink
doc: fix format arguments description
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeAR authored and Trott committed Oct 14, 2019
1 parent 1fbfc1b commit ddc27dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ The `--throw-deprecation` command line flag and `process.throwDeprecation`
property take precedence over `--trace-deprecation` and
`process.traceDeprecation`.

## util.format(format\[, ...args\])
## util.format(\[format\]\[, ...args\])
<!-- YAML
added: v0.5.3
changes:
Expand Down Expand Up @@ -214,6 +214,8 @@ changes:
-->

* `format` {string} A `printf`-like format string.
* `...args` {any}
* Returns: {string} The formatted string

The `util.format()` method returns a formatted string using the first argument
as a `printf`-like format string which can contain zero or more format
Expand Down Expand Up @@ -241,7 +243,6 @@ corresponding argument. Supported specifiers are:
* `%c` - `CSS`. This specifier is currently ignored, and will skip any CSS
passed in.
* `%%` - single percent sign (`'%'`). This does not consume an argument.
* Returns: {string} The formatted string

If a specifier does not have a corresponding argument, it is not replaced:

Expand Down Expand Up @@ -282,13 +283,15 @@ util.format('%% %s');
Some input values can have a significant performance overhead that can block the
event loop. Use this function with care and never in a hot code path.

## util.formatWithOptions(inspectOptions, format\[, ...args\])
## util.formatWithOptions(inspectOptions\[, format\]\[, ...args\])
<!-- YAML
added: v10.0.0
-->

* `inspectOptions` {Object}
* `format` {string}
* `...args` {any}
* Returns: {string}

This function is identical to [`util.format()`][], except in that it takes
an `inspectOptions` argument which specifies options that are passed along to
Expand Down

0 comments on commit ddc27dc

Please sign in to comment.