Comparing version 1.2.11 to 1.2.12
@@ -516,5 +516,5 @@ "use strict"; | ||
if (adapter.parser.declare) fnLiteral += adapter.parser.declare; | ||
fnLiteral += "\nisParsing=true"; | ||
fnLiteral += "\nisParsing=true\n"; | ||
const parser = typeof hooks.parse === "string" ? hooks.parse : Array.isArray(hooks.parse) && hooks.parse.length === 1 ? typeof hooks.parse[0] === "string" ? hooks.parse[0] : typeof hooks.parse[0].fn === "string" ? hooks.parse[0].fn : void 0 : void 0; | ||
if (parser && parser in defaultParsers) { | ||
if (parser && defaultParsers.includes(parser)) { | ||
const reporter = report("parse", { | ||
@@ -521,0 +521,0 @@ total: hooks.parse?.length |
@@ -475,4 +475,7 @@ import type { Elysia, AnyElysia } from '.'; | ||
export type ResolveResolutionsArray<T extends any[], Carry extends Record<RecordKey, unknown> = {}> = T extends [infer Fn extends AnyContextFn, ...infer Rest] ? ReturnType<Fn> extends infer Value extends Record<keyof any, unknown> ? ResolveResolutionsArray<Rest, Value & Carry> : ResolveResolutionsArray<Rest, Carry> : Prettify<Carry>; | ||
export type AnyLocalHook = LocalHook<any, any, any, any, any>; | ||
export type LocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Errors extends Record<string, Error>, Macro extends BaseMacro, Parser extends string = ''> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Macro & NoInfer<{ | ||
export type AnyLocalHook = LocalHook<any, any, any, any, any, any>; | ||
type LocalHookKey = keyof InputSchema<any> | 'detail' | 'parse' | 'transform' | 'beforeHandle' | 'afterHandle' | 'mapResponse' | 'afterResponse' | 'error' | 'tags'; | ||
export type LocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Errors extends Record<string, Error>, Macro extends BaseMacro, MacroKey extends keyof any, Parser extends string = ''> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Macro & NoInfer<keyof Macro extends '' ? {} : { | ||
[K in Exclude<keyof Macro, MacroKey | LocalHookKey>]: never; | ||
}> & NoInfer<{ | ||
detail?: DocumentDecoration; | ||
@@ -479,0 +482,0 @@ /** |
import type { ElysiaWS } from './index'; | ||
import { WebSocketHandler } from './bun'; | ||
import type { Context } from '../context'; | ||
import { AfterHandler, AfterResponseHandler, BaseMacro, ContentType, DocumentDecoration, ErrorHandler, InputSchema, Isolate, MapResponse, MaybeArray, MaybePromise, OptionalHandler, Prettify, RouteSchema, SingletonBase, TransformHandler } from '../types'; | ||
import { AfterHandler, AfterResponseHandler, BaseMacro, DocumentDecoration, ErrorHandler, InputSchema, Isolate, MapResponse, MaybeArray, MaybePromise, OptionalHandler, Prettify, RouteSchema, SingletonBase, TransformHandler } from '../types'; | ||
type TypedWebSocketMethod = 'open' | 'message' | 'drain' | 'close' | 'ping' | 'pong'; | ||
@@ -24,16 +24,7 @@ export type FlattenResponse<Response extends RouteSchema['response']> = {} extends Response ? unknown : Response[keyof Response]; | ||
}>, message: unknown) => MaybePromise<Route['body'] | void | undefined>; | ||
export type AnyWSLocalHook = WSLocalHook<any, any, any, any>; | ||
export type WSLocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Extension extends BaseMacro> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Extension & { | ||
/** | ||
* Short for 'Content-Type' | ||
* | ||
* Available: | ||
* - 'none': do not parse body | ||
* - 'text' / 'text/plain': parse body as string | ||
* - 'json' / 'application/json': parse body as json | ||
* - 'formdata' / 'multipart/form-data': parse body as form-data | ||
* - 'urlencoded' / 'application/x-www-form-urlencoded: parse body as urlencoded | ||
* - 'arraybuffer': parse body as readable stream | ||
*/ | ||
type?: ContentType; | ||
export type AnyWSLocalHook = WSLocalHook<any, any, any, any, any>; | ||
type WSLocalHookKey = keyof TypedWebSocketHandler<any, any> | 'detail' | 'upgrade' | 'parse' | 'transform' | 'beforeHandle' | 'afterHandle' | 'mapResponse' | 'afterResponse' | 'error' | 'tags' | keyof InputSchema<any>; | ||
export type WSLocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Macro extends BaseMacro, MacroKey extends keyof any> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Macro & NoInfer<{ | ||
[K in Exclude<keyof Macro, MacroKey | WSLocalHookKey>]: never; | ||
}> & { | ||
detail?: DocumentDecoration; | ||
@@ -40,0 +31,0 @@ /** |
@@ -475,4 +475,7 @@ import type { Elysia, AnyElysia } from '.'; | ||
export type ResolveResolutionsArray<T extends any[], Carry extends Record<RecordKey, unknown> = {}> = T extends [infer Fn extends AnyContextFn, ...infer Rest] ? ReturnType<Fn> extends infer Value extends Record<keyof any, unknown> ? ResolveResolutionsArray<Rest, Value & Carry> : ResolveResolutionsArray<Rest, Carry> : Prettify<Carry>; | ||
export type AnyLocalHook = LocalHook<any, any, any, any, any>; | ||
export type LocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Errors extends Record<string, Error>, Macro extends BaseMacro, Parser extends string = ''> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Macro & NoInfer<{ | ||
export type AnyLocalHook = LocalHook<any, any, any, any, any, any>; | ||
type LocalHookKey = keyof InputSchema<any> | 'detail' | 'parse' | 'transform' | 'beforeHandle' | 'afterHandle' | 'mapResponse' | 'afterResponse' | 'error' | 'tags'; | ||
export type LocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Errors extends Record<string, Error>, Macro extends BaseMacro, MacroKey extends keyof any, Parser extends string = ''> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Macro & NoInfer<keyof Macro extends '' ? {} : { | ||
[K in Exclude<keyof Macro, MacroKey | LocalHookKey>]: never; | ||
}> & NoInfer<{ | ||
detail?: DocumentDecoration; | ||
@@ -479,0 +482,0 @@ /** |
import type { ElysiaWS } from './index'; | ||
import { WebSocketHandler } from './bun'; | ||
import type { Context } from '../context'; | ||
import { AfterHandler, AfterResponseHandler, BaseMacro, ContentType, DocumentDecoration, ErrorHandler, InputSchema, Isolate, MapResponse, MaybeArray, MaybePromise, OptionalHandler, Prettify, RouteSchema, SingletonBase, TransformHandler } from '../types'; | ||
import { AfterHandler, AfterResponseHandler, BaseMacro, DocumentDecoration, ErrorHandler, InputSchema, Isolate, MapResponse, MaybeArray, MaybePromise, OptionalHandler, Prettify, RouteSchema, SingletonBase, TransformHandler } from '../types'; | ||
type TypedWebSocketMethod = 'open' | 'message' | 'drain' | 'close' | 'ping' | 'pong'; | ||
@@ -24,16 +24,7 @@ export type FlattenResponse<Response extends RouteSchema['response']> = {} extends Response ? unknown : Response[keyof Response]; | ||
}>, message: unknown) => MaybePromise<Route['body'] | void | undefined>; | ||
export type AnyWSLocalHook = WSLocalHook<any, any, any, any>; | ||
export type WSLocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Extension extends BaseMacro> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Extension & { | ||
/** | ||
* Short for 'Content-Type' | ||
* | ||
* Available: | ||
* - 'none': do not parse body | ||
* - 'text' / 'text/plain': parse body as string | ||
* - 'json' / 'application/json': parse body as json | ||
* - 'formdata' / 'multipart/form-data': parse body as form-data | ||
* - 'urlencoded' / 'application/x-www-form-urlencoded: parse body as urlencoded | ||
* - 'arraybuffer': parse body as readable stream | ||
*/ | ||
type?: ContentType; | ||
export type AnyWSLocalHook = WSLocalHook<any, any, any, any, any>; | ||
type WSLocalHookKey = keyof TypedWebSocketHandler<any, any> | 'detail' | 'upgrade' | 'parse' | 'transform' | 'beforeHandle' | 'afterHandle' | 'mapResponse' | 'afterResponse' | 'error' | 'tags' | keyof InputSchema<any>; | ||
export type WSLocalHook<LocalSchema extends InputSchema, Schema extends RouteSchema, Singleton extends SingletonBase, Macro extends BaseMacro, MacroKey extends keyof any> = (LocalSchema extends {} ? LocalSchema : Isolate<LocalSchema>) & Macro & NoInfer<{ | ||
[K in Exclude<keyof Macro, MacroKey | WSLocalHookKey>]: never; | ||
}> & { | ||
detail?: DocumentDecoration; | ||
@@ -40,0 +31,0 @@ /** |
{ | ||
"name": "elysia", | ||
"description": "Ergonomic Framework for Human", | ||
"version": "1.2.11", | ||
"version": "1.2.12", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "saltyAom", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1847815
24
29767
12
202