Skip to content

Commit

Permalink
Fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospassos committed Oct 14, 2024
1 parent ec5dc29 commit bacbd82
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type CroctMiddlewareParams =

export function withCroct(): NextMiddleware;
export function withCroct(next: NextMiddleware): NextMiddleware;
// eslint-disable-next-line @typescript-eslint/no-shadow -- False positive
export function withCroct(next: NextMiddleware, matcher: MiddlewareMatcher): NextMiddleware;
export function withCroct(props: CroctMiddlewareOptions): NextMiddleware;

Expand All @@ -68,10 +69,10 @@ export function withCroct(...args: CroctMiddlewareParams): NextMiddleware {
return withCroct({next: args[0], matcher: args[1]});
}

const {next, matcher = [], localeResolver, userIdResolver} = args[0];
const {next, matcher: matchers = [], localeResolver, userIdResolver} = args[0];

const matchesMiddleware = createMatcher((Array.isArray(matcher) ? matcher : [matcher]).flatMap(definition => {
if (definition === matcher) {
const matchesMiddleware = createMatcher((Array.isArray(matchers) ? matchers : [matchers]).flatMap(definition => {
if (definition === matchers) {
// Exclude the default matcher from the list of matchers
return [];
}
Expand Down

0 comments on commit bacbd82

Please sign in to comment.