File tree Expand file tree Collapse file tree 6 files changed +7
-48
lines changed
Expand file tree Collapse file tree 6 files changed +7
-48
lines changed Original file line number Diff line number Diff line change 11# 1.4.22
22Bug fix:
33- ValueError with summary missing types
4+ - Elysia not using Bun.routes
45
56# 1.4.21 - 4 Jan 2026
67Improvement:
Original file line number Diff line number Diff line change 1- import { Elysia , t } from '../src'
1+ import { Elysia } from '../src'
22
3- export const errorHandler = new Elysia ( { name : "error-handler" } )
4- . onError ( ( { code, error, status } ) => {
5- switch ( code ) {
6- case "VALIDATION" : {
7- const allErrors = error . detail
8-
9- return status ( 422 , {
10- status : 422 ,
11- message : error . valueError ?. message ,
12- details : {
13- location : error . type ,
14- rejected_value : error . value ,
15- expected : error . expected ,
16- } ,
17- } )
18- }
19- case "NOT_FOUND" : {
20- return status ( 404 , {
21- status : 404 ,
22- message : "Route not found" ,
23- } )
24- }
25- default : {
26- const statusCode =
27- "status" in error
28- ? ( typeof error . status === "number" ? error . status : Number ( error . status ) ) || 500
29- : 500
30-
31- let errMsg = "An error occurred"
32- if ( error instanceof Error && error . message ) {
33- errMsg = error . message
34- }
35-
36- return status ( statusCode , {
37- status : statusCode ,
38- message : errMsg ,
39- } )
40- }
41- }
42- } )
43- . as ( "scoped" )
3+ const app = new Elysia ( ) . get ( '/' , ( ) => 'a' ) . listen ( 3000 )
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ const supportedMethods = {
8484} as const
8585
8686const mapRoutes = ( app : AnyElysia ) => {
87- if ( ! app . config . aot || ! app . config . systemRouter ) return undefined
87+ if ( ! app . config . aot || app . config . systemRouter === false ) return undefined
8888
8989 const routes = < Record < string , Function | Record < string , unknown > > > { }
9090
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ export const responseToSetHeaders = (
136136 return set
137137}
138138
139- type CreateHandlerParameter = {
139+ interface CreateHandlerParameter {
140140 mapResponse (
141141 response : unknown ,
142142 set : Context [ 'set' ] ,
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { AnyElysia, Cookie } from './index'
33import { Value , TransformDecodeError } from '@sinclair/typebox/value'
44import {
55 Kind ,
6- OptionalKind ,
76 TypeBoxError ,
87 type TAnySchema ,
98 type TSchema
@@ -372,11 +371,9 @@ const matchFnReturn = /(?:return|=>)\s?\S+\(|a(?:sync|wait)/
372371
373372export const isAsync = ( v : Function | HookContainer ) => {
374373 const isObject = typeof v === 'object'
375-
376374 if ( isObject && v . isAsync !== undefined ) return v . isAsync
377375
378376 const fn = isObject ? v . fn : v
379-
380377 if ( fn . constructor . name === 'AsyncFunction' ) return true
381378
382379 const literal : string = fn . toString ( )
@@ -388,7 +385,6 @@ export const isAsync = (v: Function | HookContainer) => {
388385 }
389386
390387 const result = matchFnReturn . test ( literal )
391-
392388 if ( isObject ) v . isAsync = result
393389
394390 return result
Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ export const fileType = async (
145145 const result = await fileTypeFromBlob ( file )
146146 if ( ! result ) throw new InvalidFileType ( name , extension )
147147
148+ console . log ( result , extension )
149+
148150 if ( typeof extension === 'string' )
149151 if ( ! checkFileExtension ( result . mime , extension ) )
150152 throw new InvalidFileType ( name , extension )
You can’t perform that action at this time.
0 commit comments