Skip to content

Commit 18b4149

Browse files
committed
fix: remove eslint errors
1 parent da24335 commit 18b4149

40 files changed

+218
-164
lines changed

dist/index.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ var RouteMiddleware = class {
186186
methods: DEFAULT_HTTP_METHODS
187187
};
188188
} else {
189-
let methods = Array.from(new Set(m.methods));
189+
const methods = Array.from(new Set(m.methods));
190190
m.name = m.name || m.middleware.name;
191191
m.methods = methods.length > 0 ? methods : DEFAULT_HTTP_METHODS;
192192
m.default = m.default || {
@@ -221,10 +221,10 @@ var RouteMiddleware = class {
221221
* will wrap
222222
*/
223223
routes(routes) {
224-
if (routes.hasOwnProperty("prototype")) {
224+
if (Object.prototype.hasOwnProperty.call(routes, "prototype")) {
225225
const routeHandlersInstance = new routes();
226226
const routeHandlers = {};
227-
for (let method of DEFAULT_HTTP_METHODS) {
227+
for (const method of DEFAULT_HTTP_METHODS) {
228228
if (routeHandlersInstance[method]) {
229229
routeHandlers[method] = routeHandlersInstance[method];
230230
}

dist/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type NextRouteHandlerContext = {
1010
/**
1111
* Represents an app API route handlers for Next.js
1212
*/
13-
type NextRouteHandler = ((request: next_server.NextRequest, context: NextRouteHandlerContext) => Promise<next_server.NextResponse<unknown>>) | ((request: next_server.NextRequest) => Promise<next_server.NextResponse<unknown>>) | (() => Promise<next_server.NextResponse<unknown>>);
13+
type NextRouteHandler = (request?: next_server.NextRequest, context?: NextRouteHandlerContext) => Promise<next_server.NextResponse<unknown>>;
1414
/**
1515
* Describes the shape of the next function passed into middleware functions.
1616
*/

dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ var RouteMiddleware = class {
161161
methods: DEFAULT_HTTP_METHODS
162162
};
163163
} else {
164-
let methods = Array.from(new Set(m.methods));
164+
const methods = Array.from(new Set(m.methods));
165165
m.name = m.name || m.middleware.name;
166166
m.methods = methods.length > 0 ? methods : DEFAULT_HTTP_METHODS;
167167
m.default = m.default || {
@@ -196,10 +196,10 @@ var RouteMiddleware = class {
196196
* will wrap
197197
*/
198198
routes(routes) {
199-
if (routes.hasOwnProperty("prototype")) {
199+
if (Object.prototype.hasOwnProperty.call(routes, "prototype")) {
200200
const routeHandlersInstance = new routes();
201201
const routeHandlers = {};
202-
for (let method of DEFAULT_HTTP_METHODS) {
202+
for (const method of DEFAULT_HTTP_METHODS) {
203203
if (routeHandlersInstance[method]) {
204204
routeHandlers[method] = routeHandlersInstance[method];
205205
}

docs/html/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)