Skip to content

Commit dd0c3c8

Browse files
committed
Fix formatting
1 parent 12bdfe0 commit dd0c3c8

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

deno.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
"./workspaces/enums",
44
"./workspaces/utils",
55
"./workspaces/math",
6-
"./workspaces/deno-deploy",
7-
"./workspaces/deno-deploy",
6+
"./workspaces/deno-server",
87
"./workspaces/core",
98
"./workspaces/tools"
109
],
1110
"tasks": {
1211
"bench": "deno bench",
1312
"bench:utils": "deno bench --filter utils",
1413
"check": "deno check workspaces/**/src/**/*.ts",
15-
"doc": "deno doc --html --name=\"@g43/tools\" --output=docs workspaces/math/src/index.ts workspaces/tools/src/index.ts workspaces/core/src/index.ts workspaces/deno-deploy/src/index.ts workspaces/enums/src/index.ts workspaces/utils/src/index.ts",
14+
"doc": "deno doc --html --name=\"@g43/tools\" --output=docs workspaces/math/src/index.ts workspaces/tools/src/index.ts workspaces/core/src/index.ts workspaces/deno-server/src/index.ts workspaces/enums/src/index.ts workspaces/utils/src/index.ts",
1615
"test": "deno test workspaces/**/src/**/*.spec.ts",
1716
"test:doc": "deno test --doc workspaces/**/src/**/*.ts",
1817
"test:coverage": "deno test --clean --coverage workspaces/**/src/**/*.spec.ts",

workspaces/deno-server/src/g43-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface CreateServerParams {
88
}
99

1010
export function createServer({ port, routes, defaultHandler, errorHandler }: CreateServerParams): void {
11-
Deno.serve({ port }, async (request: Request) => {
11+
Deno.serve({ port }, (request: Request) => {
1212
const params: G43ServerRouteHandlerParams = {
1313
url: new URL(request.url),
1414
request,

workspaces/deno-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from "./response-utils.ts";
22
export * from "./g43-server-route.ts";
3-
export * from "./g43-server.ts";
3+
export * from "./g43-server.ts";
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**
22
* Creates a HTTP redirect response with the specified URL.
3-
*
3+
*
44
* @param url - The URL to redirect to.
55
* @param headers - Optional `Headers` object to include additional headers. Defaults to an empty `Headers` object.
66
* @param body - Optional body to include in the response. Defaults to `null`.
77
* @returns A `Response` object with a `302` status and the `Location` header set to the specified URL.
88
*/
99
export function createRedirectResponse(
10-
url: string,
11-
headers: Headers = new Headers(),
12-
body: unknown = null
10+
url: string,
11+
headers: Headers = new Headers(),
12+
body: unknown = null,
1313
): Response {
1414
headers.set("location", url);
1515

@@ -21,7 +21,7 @@ export function createRedirectResponse(
2121

2222
/**
2323
* Creates a HTTP error response with a 500 status code.
24-
*
24+
*
2525
* @param error - The error message to include in the response body.
2626
* @returns A `Response` object with a `500` status and an error message in the JSON body.
2727
*/
@@ -31,7 +31,7 @@ export function createErrorResponse(error: string): Response {
3131

3232
/**
3333
* Creates a HTTP unauthorized response with a 401 status code.
34-
*
34+
*
3535
* @param error - Optional error message to include in the response body. Defaults to "Unauthorized".
3636
* @returns A `Response` object with a `401` status and an error message in the JSON body.
3737
*/
@@ -41,13 +41,13 @@ export function createUnathorizedResponse(error = "Unauthorized"): Response {
4141

4242
/**
4343
* Creates a HTTP success response with a `200` status code.
44-
*
45-
* @param body - A record containing key-value pairs to include in the response body.
44+
*
45+
* @param body - A record containing key-value pairs to include in the response body.
4646
* The values can be strings, numbers, or booleans.
4747
* @returns A `Response` object with a `200` status, `success: true` in the body, and any additional data provided.
4848
*/
4949
export function createSuccessResponse(
50-
body: Record<string, string | number | boolean>
50+
body: Record<string, string | number | boolean>,
5151
): Response {
5252
return Response.json({ success: true, ...body });
5353
}

0 commit comments

Comments
 (0)