diff options
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/util.md | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index beb79ae0f8..6a8b30ef7a 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -220,15 +220,17 @@ as a `printf`-like format string which can contain zero or more format specifiers. Each specifier is replaced with the converted value from the corresponding argument. Supported specifiers are: -* `%s` - `String`. -* `%d` - `Number` (integer or floating point value) or `BigInt`. -* `%i` - Integer or `BigInt`. -* `%f` - Floating point value. -* `%j` - JSON. Replaced with the string `'[Circular]'` if the argument -contains circular references. -* `%o` - `Object`. A string representation of an object - with generic JavaScript object formatting. - Similar to `util.inspect()` with options +* `%s` - `String` will be used to convert all values except `BigInt` and + `Object`. `BigInt` values will be represented with an `n` and Objects are + inspected using `util.inspect()` with options + `{ depth: 0, colors: false, compact: 3 }`. +* `%d` - `Number` will be used to convert all values except `BigInt`. +* `%i` - `parseInt(value, 10)` is used for all values except `BigInt`. +* `%f` - `parseFloat(value)` is used for all values. +* `%j` - JSON. Replaced with the string `'[Circular]'` if the argument contains + circular references. +* `%o` - `Object`. A string representation of an object with generic JavaScript + object formatting. Similar to `util.inspect()` with options `{ showHidden: true, showProxy: true }`. This will show the full object including non-enumerable properties and proxies. * `%O` - `Object`. A string representation of an object with generic JavaScript |