Skip to content

Commit

Permalink
🎉 release: Elysia 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Mar 16, 2024
1 parent e84e16b commit a20d6a6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 0 additions & 2 deletions example/a.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ import { Elysia } from '../src'
const app = new Elysia({ precompile: true })
.get('/', Bun.file('test/kyuukurarin.mp4'))
.listen(3000)

console.log(app.routes[0].composed?.toString())
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "elysia",
"description": "Ergonomic Framework for Human",
"version": "1.0.0-rc.19",
"version": "1.0.0",
"author": {
"name": "saltyAom",
"url": "https://github.com/SaltyAom",
Expand Down
6 changes: 5 additions & 1 deletion src/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ export const composeHandler = ({
if (!isHandleFn) handler = mapCompactResponse(handler)

const hasErrorHandler =
(app.config.forceErrorEncapsulation && isHandleFn) ||
(app.config.forceErrorEncapsulation &&
(isHandleFn ||
hooks.afterHandle.length > 0 ||
hooks.beforeHandle.length > 0 ||
hooks.transform.length > 0)) ||
hooks.error.length > 0 ||
app.event.error.length > 0 ||
typeof Bun === 'undefined' ||
Expand Down
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ export default class Elysia<
resolve: {}
} as Singleton

get store(): Singleton['store'] {
return this.singleton.store
}

get decorator(): Singleton['decorator'] {
return this.singleton.decorator
}

protected definitions = {
type: {} as Record<string, TSchema>,
error: {} as Record<string, Error>
Expand Down

0 comments on commit a20d6a6

Please sign in to comment.