mirror of
https://github.com/pockethost/pockethost.git
synced 2025-09-15 21:20:11 +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
|
if (!filter) return initialValue
|
||||||
return filter.reduce(
|
return filter.reduce(
|
||||||
(carry, entry) =>
|
(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),
|
Promise.resolve(initialValue),
|
||||||
) as TCarry
|
) as TCarry
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user