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