From 1ea83d82e117a226f95b41a508ab27ce8072353b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 12 Jun 2024 12:31:07 -0700 Subject: [PATCH 1/2] [Dev Deps] update `@ljharb/eslint-config` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c60c6e..808b35e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "parse argument options", "main": "index.js", "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", + "@ljharb/eslint-config": "^21.1.1", "aud": "^2.0.4", "auto-changelog": "^2.4.0", "eslint": "=8.8.0", From bedaa8b9ab5a901fa342aad4494cbbf676b11a21 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 12 Jun 2024 18:20:19 +0200 Subject: [PATCH 2/2] [Tests] add a test case for dotted notation (from #66) --- test/dotted.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/dotted.js b/test/dotted.js index 126ff03..c606118 100644 --- a/test/dotted.js +++ b/test/dotted.js @@ -22,3 +22,15 @@ test('dotted default with no alias', function (t) { t.equal(argv.a.b, 11); t.end(); }); + +test('dotted array', function (t) { + var argv = parse(['--a.1.foo', '11']); + + t.notOk(Array.isArray(argv.a)); + + t.notOk(0 in argv.a); + + t.equal(argv.a[1].foo, 11); + + t.end(); +});