This commit is contained in:
parent
307898c56b
commit
54dc49d055
@ -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()
|
||||||
])
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user