download index
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
ale 2024-09-23 04:30:26 +02:00
parent df2902613d
commit 755e88ba07

View File

@ -5,7 +5,7 @@ module.exports = (app, client) => {
zlib = require('zlib'), zlib = require('zlib'),
{ chain } = require('stream-chain'), { chain } = require('stream-chain'),
{ parser } = require('stream-json'), { parser } = require('stream-json'),
{ streamValues } = require('stream-json/streamers/StreamValues'), { stringer } = require('stream-json/jsonl/Stringer'),
{ streamArray } = require('stream-json/streamers/StreamArray'), { streamArray } = require('stream-json/streamers/StreamArray'),
clean = str => { clean = str => {
return str.replace(/[\/\\^$+?()`'¡¿¨!"·%&=;,\|\[\]{}]+/gmi, '') return str.replace(/[\/\\^$+?()`'¡¿¨!"·%&=;,\|\[\]{}]+/gmi, '')
@ -516,7 +516,6 @@ module.exports = (app, client) => {
chain([ chain([
result, result,
parser(), parser(),
streamValues(),
data => data.value.hits.hits, data => data.value.hits.hits,
streamArray(), streamArray(),
data => ({ data => ({
@ -526,9 +525,9 @@ module.exports = (app, client) => {
last: data.value._source.last, last: data.value._source.last,
nodeinfo: data.value._source.nodeinfo nodeinfo: data.value._source.nodeinfo
}), }),
zlib.createGzip(), stringer(),
res zlib.createGzip()
]) ]).pipe(res, { end: true })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
res.status(404).end() res.status(404).end()