diff --git a/.changeset/violet-hats-brake.md b/.changeset/violet-hats-brake.md new file mode 100644 index 00000000..a0a89ae4 --- /dev/null +++ b/.changeset/violet-hats-brake.md @@ -0,0 +1,5 @@ +--- +'pockethost': minor +--- + +Enhancement: filters now have extensible data types diff --git a/packages/pockethost/src/common/plugin/filter.ts b/packages/pockethost/src/common/plugin/filter.ts index fc4ac0b1..0d137506 100644 --- a/packages/pockethost/src/common/plugin/filter.ts +++ b/packages/pockethost/src/common/plugin/filter.ts @@ -81,8 +81,15 @@ function createCustomFilterWithContext( return [ async (initialValue: TCarry, context: TContext) => filter(filterName, initialValue, context), - async (handler: FilterHandler, priority = 10) => - registerFilter(filterName, handler, priority), + async ( + handler: FilterHandler, + priority = 10, + ) => + registerFilter( + filterName, + handler, + priority, + ), ] as const } @@ -90,8 +97,11 @@ function createCustomFilter(filterName: string) { return [ async (initialValue: TCarry) => filter(filterName, initialValue, {}), - async (handler: FilterHandler, priority = 10) => - registerFilter(filterName, handler, priority), + async ( + handler: FilterHandler, + priority = 10, + ) => + registerFilter(filterName, handler, priority), ] as const }