From 43b7470c7df6e8d7275b505aff705f3d6e52a22a Mon Sep 17 00:00:00 2001 From: Wassim Chegham Date: Wed, 16 Feb 2022 16:35:25 +0100 Subject: [PATCH 1/2] docs: update usage example for npm pkg Add example for setting array values Fixes #4320 --- lib/commands/pkg.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/commands/pkg.js b/lib/commands/pkg.js index 007932429d661..6ca892293cebe 100644 --- a/lib/commands/pkg.js +++ b/lib/commands/pkg.js @@ -9,6 +9,8 @@ class Pkg extends BaseCommand { 'set = [= ...]', 'get [ [ ...]]', 'delete [ ...]', + 'set [[].= ...]', + 'set [[].= ...]', ] static params = [ From 3e5ed3e99405ef47f0d79d289f896bf48fa60ee5 Mon Sep 17 00:00:00 2001 From: Wassim Chegham Date: Wed, 16 Feb 2022 22:36:02 +0100 Subject: [PATCH 2/2] fix: update test snapshots Fixes #4320 --- tap-snapshots/test/lib/load-all-commands.js.test.cjs | 2 ++ tap-snapshots/test/lib/utils/npm-usage.js.test.cjs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index c9da1e23671ea..d84cdfb305e90 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -690,6 +690,8 @@ Usage: npm pkg set = [= ...] npm pkg get [ [ ...]] npm pkg delete [ ...] +npm pkg set [[].= ...] +npm pkg set [[].= ...] Options: [-f|--force] [--json] diff --git a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs index f91f2b11d3533..42c24fabdfd61 100644 --- a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs +++ b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs @@ -773,6 +773,8 @@ All commands: npm pkg set = [= ...] npm pkg get [ [ ...]] npm pkg delete [ ...] + npm pkg set [[].= ...] + npm pkg set [[].= ...] Options: [-f|--force] [--json]