Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
- readme upd
- interface name fix
- test api using fix
  • Loading branch information
krutoo committed Dec 28, 2023
1 parent 218f2a8 commit 18a5484
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,5 @@ Bun.serve({
## To do

- JWT middleware
- retry middleware
- ~~ability to use with Bun's `Bun.serve` and Deno's `serve` from `std/http`~~
2 changes: 1 addition & 1 deletion src/__test__/configure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('applyMiddleware', () => {

await handler(new Request('https://fake.com/for-tests'));

assert.deepEqual(log, [
assert.deepStrictEqual(log, [
// expected log
'<foo>',
'<bar>',
Expand Down
4 changes: 2 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Middleware, CookieStore } from './types';

/** Options for defaultHeaders middleware. */
export interface DefaultHeadersOptions {
export interface ValidateStatusOptions {
getThrowable?: (response: Response) => any;
}

Expand Down Expand Up @@ -60,7 +60,7 @@ export function validateStatus(
validate: (status: number, request: Request, response: Response) => boolean,
{
getThrowable = response => new Error(`Request failed with status ${response.status}`),
}: DefaultHeadersOptions = {},
}: ValidateStatusOptions = {},
): Middleware {
return async (request, next) => {
const response = await next(request);
Expand Down

0 comments on commit 18a5484

Please sign in to comment.