Skip to content

Commit a8a5368

Browse files
committed
Fix CustomCollectionCallbacks authorizePredicate type parameter
Changed `keyof TParam & string` to `TParam` in authorize callbacks. Since TParam is now `string` instead of `Record<string, string>`, `keyof TParam` would incorrectly resolve to string method names like "toString", "charAt", etc. This fixes type checking errors introduced when refactoring collection dispatcher types from Record-based to string-based parameters.
1 parent 7e49ab8 commit a8a5368

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/fedify/src/federation/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ export class FederationBuilderImpl<TContextData>
15201520
authorize(
15211521
predicate: ObjectAuthorizePredicate<
15221522
TContextData,
1523-
keyof TParam & string
1523+
TParam
15241524
>,
15251525
) {
15261526
callbacks.authorizePredicate = predicate;

packages/fedify/src/federation/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ export interface CustomCollectionCallbacks<
912912
*/
913913
authorizePredicate?: ObjectAuthorizePredicate<
914914
TContextData,
915-
keyof TParam & string
915+
TParam
916916
>;
917917
}
918918

0 commit comments

Comments
 (0)