Skip to content

Commit

Permalink
fix: bump elysia to 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bogeychan committed Dec 24, 2024
1 parent b59fb33 commit ace7f25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
"release": "npm run build && npm run test && npm publish --access public"
},
"peerDependencies": {
"elysia": ">= 1.1.0"
"elysia": ">= 1.2.2"
},
"devDependencies": {
"@types/bun": "^1.1.14",
"elysia": "1.1.0",
"elysia": "1.2.2",
"pino-pretty": "^13.0.0",
"tsd": "^0.31.2",
"typescript": "^5.7.2"
},
"dependencies": {
"pino": "^9.5.0"
"pino": "^9.6.0"
},
"homepage": "https://github.com/bogeychan/elysia-logger",
"bugs": "https://github.com/bogeychan/elysia-logger/issues",
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function into(this: Logger, options: ElysiaLoggerOptions = {}) {
.onRequest((ctx) => {
ctx.store = { ...ctx.store, startTime: performance.now() };
})
.onAfterResponse({ as: "global" }, (ctx) => {
.onAfterResponse((ctx) => {
const loggerCtx = ctx as unknown as ElysiaLoggerContext;
loggerCtx.isError = false;

Expand All @@ -132,7 +132,7 @@ function into(this: Logger, options: ElysiaLoggerOptions = {}) {

log[useLevel](ctx);
})
.onError({ as: "global" }, (ctx) => {
.onError((ctx) => {
const loggerCtx = ctx as ElysiaLoggerContext;
loggerCtx.isError = true;

Expand All @@ -151,7 +151,8 @@ function into(this: Logger, options: ElysiaLoggerOptions = {}) {
} else {
log.error(ctx);
}
});
})
.as("global");
}

return app;
Expand Down
2 changes: 0 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export type Logger = pino.Logger & BaseLoggerOptions;

export type InferContext<T> = T extends Elysia<
infer _Path,
infer _Scoped,
infer Singleton,
infer Definitions,
infer _Metadata,
Expand Down Expand Up @@ -160,7 +159,6 @@ export type _INTERNAL_ElysiaLoggerPlugin<
Store extends Elysia["store"] = Elysia["store"]
> = Elysia<
"",
false,
{
store: Store;
derive: { readonly log: Logger };
Expand Down

0 comments on commit ace7f25

Please sign in to comment.