From 2d682e4cab0cf109a16332f3222f1e9a4027db69 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 1 Mar 2021 11:03:43 -0800 Subject: [PATCH] fix(search): don't pass unused args The searchopts get parsed and added to the query elsewhere, they're not part of the `include` array they are an extra querystring that is added to the search request. PR-URL: https://github.com/npm/cli/pull/2803 Credit: @wraithgar Close: #2803 Reviewed-by: @ruyadorno --- lib/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/search.js b/lib/search.js index ba6c28163bd97..e0922b9846cdb 100644 --- a/lib/search.js +++ b/lib/search.js @@ -8,7 +8,7 @@ const packageFilter = require('./search/package-filter.js') const output = require('./utils/output.js') const usageUtil = require('./utils/usage.js') -function prepareIncludes (args, searchopts) { +function prepareIncludes (args) { return args .map(s => s.toLowerCase()) .filter(s => s) @@ -47,7 +47,7 @@ class Search { const opts = { ...this.npm.flatOptions, ...this.npm.flatOptions.search, - include: prepareIncludes(args, this.npm.flatOptions.search.opts), + include: prepareIncludes(args), exclude: prepareExcludes(this.npm.flatOptions.search.exclude), }