Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
format using node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaofeiCao committed May 28, 2024
1 parent 29e9f84 commit a08469f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions packages/cadl-ranch-api/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ export type KeyedMockRequestHandler<T extends string = string> = (

export type HttpMethod = "get" | "post" | "put" | "patch" | "delete" | "head" | "options";

export type MockApiForHandler<Handler extends MockRequestHandler> = Handler extends KeyedMockRequestHandler<infer K>
? KeyedMockApi<K>
: MockApi;
export type MockApiForHandler<Handler extends MockRequestHandler> =
Handler extends KeyedMockRequestHandler<infer K> ? KeyedMockApi<K> : MockApi;

export interface MockApi {
method: HttpMethod;
Expand Down
4 changes: 2 additions & 2 deletions packages/cadl-ranch-expect/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ function getRouteSegments(program: Program, target: Operation | Interface | Name
return target.interface
? [...getRouteSegments(program, target.interface), ...seg]
: target.namespace
? [...getRouteSegments(program, target.namespace), ...seg]
: seg;
? [...getRouteSegments(program, target.namespace), ...seg]
: seg;
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/cadl-ranch/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const errorHandler: ErrorRequestHandler = (err, _req, res, _next) => {
const errResponse = err.toJSON
? err.toJSON()
: err instanceof Error
? { name: err.name, message: err.message, stack: err.stack }
: err;
? { name: err.name, message: err.message, stack: err.stack }
: err;

res.status(err.status || 500);
res.contentType("application/json").send(errResponse).end();
Expand Down

0 comments on commit a08469f

Please sign in to comment.