diff options
author | nlf <quitlahok@gmail.com> | 2020-12-09 01:03:32 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-12-09 02:57:33 +0300 |
commit | 3db90d94474f673591811fdab5eb6a5bfdeba261 (patch) | |
tree | 73db575b3b56dac525b10c1abafec83c5956f481 /lib/utils | |
parent | 0ef25b6cd2921794d36f066e2b11c406342cf167 (diff) |
allow for passing object keys to searchopts to allow paginationnlf/search-opts
PR-URL: https://github.com/npm/cli/pull/2303
Credit: @nlf
Close: #2303
Reviewed-by: @isaacs
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/flat-options.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js index 8b6864aa8..9b83de8c4 100644 --- a/lib/utils/flat-options.js +++ b/lib/utils/flat-options.js @@ -3,6 +3,7 @@ const log = require('npmlog') const crypto = require('crypto') +const querystring = require('querystring') const npmSession = crypto.randomBytes(8).toString('hex') log.verbose('npm-session', npmSession) const { join } = require('path') @@ -92,7 +93,7 @@ const flatten = obj => ({ description: obj.description, exclude: obj.searchexclude, limit: obj.searchlimit || 20, - opts: obj.searchopts, + opts: querystring.parse(obj.searchopts), staleness: obj.searchstaleness, }, |