From db5aeed7023504c76275bb88aceb835ac3313e5c Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Fri, 7 Oct 2022 16:11:32 +0200 Subject: [PATCH] util: add default value option to parsearg Users can set a default value for every expected input argument PR-URL: https://github.com/nodejs/node/pull/44631 Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- doc/api/util.md | 10 +- lib/internal/util/parse_args/parse_args.js | 56 ++++++- lib/internal/util/parse_args/utils.js | 14 ++ lib/internal/validators.js | 32 ++++ test/parallel/test-parse-args.mjs | 169 +++++++++++++++++++++ 5 files changed, 278 insertions(+), 3 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 655f76b7ce2e8b..b7801929fa5f5e 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1025,7 +1025,12 @@ equality.