From 1d98a0707c3e61e362d2d3d5413b475437b5de0e Mon Sep 17 00:00:00 2001 From: n loewen Date: Sat, 23 Sep 2023 19:16:25 -0700 Subject: [PATCH] Add some JSDoc annotations to make type-checking warnings go away --- opter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opter.js b/opter.js index 692ae51..5cdc353 100644 --- a/opter.js +++ b/opter.js @@ -40,7 +40,9 @@ module.exports = class Opter { parse(argv) { this.userOptions = argvToObject(argv); - // collect user opts with the long names as keys, for output + /** + * @type {Object>} + * The user-provided with ther long names as the keys **/ let normalizedUserOptions = {}; Object.keys(this.definedOptions).forEach(longName => { @@ -128,6 +130,7 @@ function argvToObject(argv) { return; }); + /** @type {Object>} **/ let out = {}; grouped.forEach((a, i) => { let next = grouped[i+1];