File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,20 @@ const handleStream = async (
124
124
if ( typeof init . value === 'object' )
125
125
try {
126
126
controller . enqueue (
127
+ // @ts -expect-error this is a valid operation
127
128
Buffer . from ( JSON . stringify ( init . value ) )
128
129
)
129
130
} catch {
130
131
controller . enqueue (
132
+ // @ts -expect-error this is a valid operation
131
133
Buffer . from ( init . value . toString ( ) )
132
134
)
133
135
}
134
- else controller . enqueue ( Buffer . from ( init . value . toString ( ) ) )
136
+ else
137
+ controller . enqueue (
138
+ // @ts -expect-error this is a valid operation
139
+ Buffer . from ( init . value . toString ( ) )
140
+ )
135
141
}
136
142
137
143
for await ( const chunk of generator ) {
@@ -141,12 +147,20 @@ const handleStream = async (
141
147
if ( typeof chunk === 'object' )
142
148
try {
143
149
controller . enqueue (
150
+ // @ts -expect-error this is a valid operation
144
151
Buffer . from ( JSON . stringify ( chunk ) )
145
152
)
146
153
} catch {
147
- controller . enqueue ( Buffer . from ( chunk . toString ( ) ) )
154
+ controller . enqueue (
155
+ // @ts -expect-error this is a valid operation
156
+ Buffer . from ( chunk . toString ( ) )
157
+ )
148
158
}
149
- else controller . enqueue ( Buffer . from ( chunk . toString ( ) ) )
159
+ else
160
+ controller . enqueue (
161
+ // @ts -expect-error this is a valid operation
162
+ Buffer . from ( chunk . toString ( ) )
163
+ )
150
164
151
165
// Wait for the next event loop
152
166
// Otherwise the data will be mixed up
Original file line number Diff line number Diff line change @@ -5515,8 +5515,9 @@ export default class Elysia<
5515
5515
if ( ! ( key in this . definitions . type ) )
5516
5516
this . definitions . type [ key ] = value as TSchema
5517
5517
} )
5518
+ // @ts -expect-error
5518
5519
this . definitions . typebox = t . Module ( {
5519
- ...this . definitions . typebox [ '$defs' ] ,
5520
+ ...this . definitions . typebox [ '$defs' ] as TModule < { } > ,
5520
5521
...name
5521
5522
} as any )
5522
5523
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ export const createHandleWSResponse = (
237
237
if ( data instanceof Promise )
238
238
return data . then ( ( data ) => handleWSResponse ( ws , data ) )
239
239
240
- if ( Buffer . isBuffer ( data ) ) return ws . send ( data )
240
+ if ( Buffer . isBuffer ( data ) ) return ws . send ( data . toString ( ) )
241
241
242
242
if ( data === undefined ) return
243
243
You can’t perform that action at this time.
0 commit comments