playing stream-json
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
ale 2024-09-28 04:58:38 +02:00
parent 307898c56b
commit 54dc49d055

View File

@ -3,8 +3,8 @@ const nodeinfo = require('activitypub-express/pub/nodeinfo')
module.exports = (app, client) => {
const constant = require('./constant'),
zlib = require('zlib'),
StreamArray = require('stream-json/streamers/StreamArray'),
{ parser } = require('stream-json'),
Pick = require('stream-json/filters/Pick'),
{ streamArray } = require('stream-json/streamers/StreamArray'),
{ chain } = require('stream-chain'),
clean = str => {
return str.replace(/[/\\^$+?()`'¡¿¨!"·%&=;,\|\[\]{}]+/gmi, '')
@ -513,9 +513,8 @@ module.exports = (app, client) => {
}
}, { asStream: true, meta: false }),
pipeline = chain([
parser(),
data => data.value.hits.hits,
StreamArray.withParser(),
Pick.withParser({ filter: 'hits.hits' }),
streamArray(),
data => data.value._source,
zlib.createGzip()
])