doc: refine util.parseArgs default definition

The default value is legal by means other than defaulting.

PR-URL: https://github.com/nodejs/node/pull/58958
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Slayer95 2025-07-15 04:00:32 -05:00 committed by GitHub
parent b305119844
commit ce4a16f50a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1955,10 +1955,12 @@ changes:
times. If `true`, all values will be collected in an array. If times. If `true`, all values will be collected in an array. If
`false`, values for the option are last-wins. **Default:** `false`. `false`, values for the option are last-wins. **Default:** `false`.
* `short` {string} A single character alias for the option. * `short` {string} A single character alias for the option.
* `default` {string | boolean | string\[] | boolean\[]} The default value to * `default` {string | boolean | string\[] | boolean\[]} The value to assign to
be used if (and only if) the option does not appear in the arguments to be the option if it does not appear in the arguments to be parsed. The value
parsed. It must be of the same type as the `type` property. When `multiple` must match the type specified by the `type` property. If `multiple` is
is `true`, it must be an array. `true`, it must be an array. No default value is applied when the option
does appear in the arguments to be parsed, even if the provided value
is falsy.
* `strict` {boolean} Should an error be thrown when unknown arguments * `strict` {boolean} Should an error be thrown when unknown arguments
are encountered, or when arguments are passed that do not match the are encountered, or when arguments are passed that do not match the
`type` configured in `options`. `type` configured in `options`.