mirror of
https://github.com/pockethost/pockethost.git
synced 2025-05-31 19:26:40 +00:00
chore(pockethost): filter debugging
This commit is contained in:
parent
879845a831
commit
dd3ceaa324
5
.changeset/great-foxes-beg.md
Normal file
5
.changeset/great-foxes-beg.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'pockethost': patch
|
||||
---
|
||||
|
||||
Added filter debugging
|
@ -63,7 +63,14 @@ async function filter<TCarry, TContext extends {} = {}>(
|
||||
if (!filter) return initialValue
|
||||
return filter.reduce(
|
||||
(carry, entry) =>
|
||||
carry.then((carryRes) => entry.handler(carryRes, context)),
|
||||
carry
|
||||
.then((carryRes) => entry.handler(carryRes, context))
|
||||
.then((carryRes) => {
|
||||
if (DEBUG()) {
|
||||
console.log(`f:${filterName}`, carryRes, context)
|
||||
}
|
||||
return carryRes
|
||||
}),
|
||||
Promise.resolve(initialValue),
|
||||
) as TCarry
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user