From ce4a16f50ae289bf6c7834b592ca47ad4634dd79 Mon Sep 17 00:00:00 2001 From: Slayer95 Date: Tue, 15 Jul 2025 04:00:32 -0500 Subject: [PATCH] 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 --- doc/api/util.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 6099f6a7b8d..e34b88b4a4f 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1955,10 +1955,12 @@ changes: times. If `true`, all values will be collected in an array. If `false`, values for the option are last-wins. **Default:** `false`. * `short` {string} A single character alias for the option. - * `default` {string | boolean | string\[] | boolean\[]} The default value to - be used if (and only if) the option does not appear in the arguments to be - parsed. It must be of the same type as the `type` property. When `multiple` - is `true`, it must be an array. + * `default` {string | boolean | string\[] | boolean\[]} The value to assign to + the option if it does not appear in the arguments to be parsed. The value + must match the type specified by the `type` property. If `multiple` is + `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 are encountered, or when arguments are passed that do not match the `type` configured in `options`.