mirror of
https://github.com/pockethost/pockethost.git
synced 2026-03-05 16:48:47 +00:00
chore(pockethost): filter debugging
This commit is contained in:
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user