diff options
author | isaacs <i@izs.me> | 2020-07-23 23:28:00 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-07-29 21:54:59 +0300 |
commit | 8654c05e6e8cabf4642425b9e6373aeae9801c21 (patch) | |
tree | a8a5053204d15c5eff467a90175526eba6233999 /lib/search | |
parent | c3b3b79b03583887ba8e63201c1a01e8043a89e9 (diff) |
lint the lib folder
Diffstat (limited to 'lib/search')
-rw-r--r-- | lib/search/format-package-stream.js | 3 | ||||
-rw-r--r-- | lib/search/package-filter.js | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/search/format-package-stream.js b/lib/search/format-package-stream.js index 0a013e3de..7a9f61613 100644 --- a/lib/search/format-package-stream.js +++ b/lib/search/format-package-stream.js @@ -3,7 +3,6 @@ // XXX these output classes should not live in here forever. it'd be good to // split them out, perhaps to libnpmsearch -const Pipeline = require('minipass-pipeline') const Minipass = require('minipass') const columnify = require('columnify') @@ -29,6 +28,7 @@ class JSONOutputStream extends Minipass { super() this._didFirst = false } + write (obj) { if (!this._didFirst) { super.write('[\n') @@ -42,6 +42,7 @@ class JSONOutputStream extends Minipass { return this.emit('error', er) } } + end () { super.write(this._didFirst ? ']\n' : '\n]\n') } diff --git a/lib/search/package-filter.js b/lib/search/package-filter.js index 892adb08c..142350eec 100644 --- a/lib/search/package-filter.js +++ b/lib/search/package-filter.js @@ -7,7 +7,7 @@ function filter (data, include, exclude, opts) { } function getWords (data, opts) { - return [ data.name ] + return [data.name] .concat((opts && opts.description) ? data.description : []) .concat((data.maintainers || []).map(function (m) { return '=' + m.name |