Skip to content

Commit

Permalink
fix(search): don't pass unused args
Browse files Browse the repository at this point in the history
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: #2803
Credit: @wraithgar
Close: #2803
Reviewed-by: @ruyadorno
  • Loading branch information
wraithgar authored and ruyadorno committed Mar 4, 2021
1 parent e69be2a commit 2d682e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/search.js
Expand Up @@ -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)
Expand Down Expand Up @@ -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),
}

Expand Down

0 comments on commit 2d682e4

Please sign in to comment.