Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed Mar 24, 2024
1 parent b3ab950 commit 44231a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { compose } from "./composition.ts";
import { type Middleware } from "./route.ts";
import { type Context } from "./context.ts";

export type ServerHandlerOptions<S> = {
export type HandlerOptions<S> = {
state?: S;
enableXResponseTimeHeader?: boolean;
enableLogger?: boolean;
pid?: { path: string; name?: string; append?: boolean };
pid?: { path: string | URL; name?: string; append?: boolean };
};

function setXResponseTimeHeader<C extends Context>(ctx: C) {
Expand Down Expand Up @@ -48,7 +48,7 @@ export function createHandler<C extends Context, S>(
enableXResponseTimeHeader = true,
enableLogger = false,
pid,
}: ServerHandlerOptions<S> = {},
}: HandlerOptions<S> = {},
) {
if (pid?.path) {
const pidString = pid.name
Expand Down
6 changes: 1 addition & 5 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import { Context } from "./context.ts";

export { Context } from "./context.ts";
export { createRoute, type Method, type Middleware } from "./route.ts";
export {
assertError,
createHandler,
type ServerHandlerOptions,
} from "./handler.ts";
export { assertError, createHandler, type HandlerOptions } from "./handler.ts";
export { compose, composeSync } from "./composition.ts";

/**
Expand Down
4 changes: 2 additions & 2 deletions test_deps.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { assertEquals } from "https://deno.land/std@0.202.0/testing/asserts.ts";
export { delay } from "https://deno.land/std@0.202.0/async/delay.ts";
export { assertEquals } from "https://deno.land/std@0.212.0/testing/asserts.ts";
export { delay } from "https://deno.land/std@0.212.0/async/delay.ts";

0 comments on commit 44231a4

Please sign in to comment.