Skip to content

Commit

Permalink
fix: lint and export type
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePresman committed Jan 2, 2024
1 parent 317ba68 commit 8204f86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const fastifyReplyFrom = fp(function from (fastify, opts, next) {
if (customRetry && customRetry.handler) {
const customRetries = customRetry.retries || 1
if (++retries < customRetries) {
return customRetry.handler({err, req, res, getDefaultDelay})
return customRetry.handler({ err, req, res, getDefaultDelay })
}
}
return getDefaultDelay()
Expand Down
13 changes: 7 additions & 6 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ declare module "fastify" {
}

type FastifyReplyFrom = FastifyPluginCallback<fastifyReplyFrom.FastifyReplyFromOptions>
export type customRetryHandler = {
err: Error;
req: FastifyRequest<RequestGenericInterface, RawServerBase>;
res: FastifyReply<RawServerBase>;
getDefaultDelay: () => number | null;
}
declare namespace fastifyReplyFrom {
type QueryStringFunction = (search: string | undefined, reqUrl: string) => string;

export type customRetryHandler = {
err: Error;
req: FastifyRequest<RequestGenericInterface, RawServerBase>;
res: FastifyReply<RawServerBase>;
getDefaultDelay: () => number | null;
}
export interface FastifyReplyFromHooks {
queryString?: { [key: string]: unknown } | QueryStringFunction;
contentType?: string;
Expand Down

0 comments on commit 8204f86

Please sign in to comment.