elysia 2.0.0-exp.44 → 2.0.0-exp.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -219,7 +219,11 @@ function captureEntry({ method, path, slot }) {
219
219
  const aotActivationError = /* @__PURE__ */ new Error("Elysia AOT capture module is not activated.");
220
220
  function beginValidatorCapture() {
221
221
  if (captureImpl === void 0) throw aotActivationError;
222
- if (activeSession?.capture !== void 0) throw new Error("[elysia-aot]: A capture session is already active.");
222
+ if (activeSession?.capture !== void 0) {
223
+ if (activeSession.explicitCapture) throw new Error("[elysia-aot]: A capture session is already active.");
224
+ activeSession.explicitCapture = true;
225
+ return;
226
+ }
223
227
  if (activeSession && !activeSession.external) throw new Error("[elysia-aot]: A compiler session is already active.");
224
228
  const session = activeSession ?? (activeSession = newCompilerSession());
225
229
  session.external = true;
@@ -218,7 +218,11 @@ function captureEntry({ method, path, slot }) {
218
218
  const aotActivationError = /* @__PURE__ */ new Error("Elysia AOT capture module is not activated.");
219
219
  function beginValidatorCapture() {
220
220
  if (captureImpl === void 0) throw aotActivationError;
221
- if (activeSession?.capture !== void 0) throw new Error("[elysia-aot]: A capture session is already active.");
221
+ if (activeSession?.capture !== void 0) {
222
+ if (activeSession.explicitCapture) throw new Error("[elysia-aot]: A capture session is already active.");
223
+ activeSession.explicitCapture = true;
224
+ return;
225
+ }
222
226
  if (activeSession && !activeSession.external) throw new Error("[elysia-aot]: A compiler session is already active.");
223
227
  const session = activeSession ?? (activeSession = newCompilerSession());
224
228
  session.external = true;
@@ -1,5 +1,5 @@
1
1
  //#region src/compile/lexer.d.ts
2
- declare const isSpace: (ch: string) => ch is "\n" | " " | "\t" | "\r";
2
+ declare const isSpace: (ch: string) => ch is " " | "\n" | "\t" | "\r";
3
3
  declare const isIdentChar: (ch: string) => boolean;
4
4
  declare const isIdentCharCode: (code: number) => boolean;
5
5
  declare function skipString(src: string, start: number): number;
package/dist/package.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region package.json
3
- var version = "2.0.0-exp.44";
3
+ var version = "2.0.0-exp.45";
4
4
 
5
5
  //#endregion
6
6
  Object.defineProperty(exports, 'version', {
package/dist/package.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "2.0.0-exp.44";
2
+ var version = "2.0.0-exp.45";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -5,8 +5,8 @@ import { hasTypes } from "./utils.js";
5
5
  import { useTypebox as useTypebox$1 } from "./bridge.js";
6
6
  import { applyCoercions, coerceBody, coerceFormData, coerceQuery, coerceRoot, coerceStringToStructure } from "./coerce.js";
7
7
  import { Ref } from "typebox/type";
8
- import { Compile } from "typebox/compile";
9
8
  import { Clone, Create, Decode, Default, HasCodec } from "typebox/value";
9
+ import { Compile } from "typebox/compile";
10
10
 
11
11
  //#region src/type/bridge-live.d.ts
12
12
  declare function useTypebox(_mod?: Parameters<typeof useTypebox$1>[0]): void;
@@ -1,17 +1,17 @@
1
1
  import { TypeBoxValidatorCache as TypeBoxValidatorCache$1 } from "./validator/validator-cache.js";
2
2
  import { TypeBoxValidator as TypeBoxValidator$1 } from "./validator/index.js";
3
- import { Intersect as Intersect$1 } from "./elysia/intersect.js";
3
+ import { Intersect as Intersect$2 } from "./elysia/intersect.js";
4
4
  import { hasTypes as hasTypes$1 } from "./utils.js";
5
5
  import { applyCoercions as applyCoercions$1, coerceBody as coerceBody$1, coerceFormData as coerceFormData$1, coerceQuery as coerceQuery$1, coerceRoot as coerceRoot$1, coerceStringToStructure as coerceStringToStructure$1 } from "./coerce.js";
6
6
  import { Ref as Ref$1, TAny, TSchema } from "typebox/type";
7
+ import { Clone as Clone$1, Create as Create$1, Decode as Decode$2, Default as Default$1, HasCodec as HasCodec$1 } from "typebox/value";
7
8
  import { Compile as Compile$1 } from "typebox/compile";
8
- import { Clone as Clone$1, Create as Create$1, Decode as Decode$1, Default as Default$1, HasCodec as HasCodec$1 } from "typebox/value";
9
9
 
10
10
  //#region src/type/bridge.d.ts
11
11
  interface TypeboxModule {
12
12
  Compile: typeof Compile$1;
13
13
  Create: typeof Create$1;
14
- Decode: typeof Decode$1;
14
+ Decode: typeof Decode$2;
15
15
  applyCoercions: typeof applyCoercions$1;
16
16
  TypeBoxValidator: TypeBoxValidator$1;
17
17
  TypeBoxValidatorCache: TypeBoxValidatorCache$1;
@@ -22,14 +22,14 @@ interface TypeboxModule {
22
22
  coerceBody: typeof coerceBody$1;
23
23
  hasTypes: typeof hasTypes$1;
24
24
  HasCodec: typeof HasCodec$1;
25
- Intersect: typeof Intersect$1;
25
+ Intersect: typeof Intersect$2;
26
26
  Default: typeof Default$1;
27
27
  Ref: typeof Ref$1;
28
28
  Clone: typeof Clone$1;
29
29
  }
30
30
  declare let Compile: typeof Compile$1;
31
31
  declare let Create: typeof Create$1;
32
- declare let Decode: typeof Decode$1;
32
+ declare let Decode: typeof Decode$2;
33
33
  declare let applyCoercions: typeof applyCoercions$1;
34
34
  declare let TypeBoxValidator: TypeBoxValidator$1;
35
35
  type TypeBoxValidator<T extends TSchema = TAny> = TypeBoxValidator$1<T>;
@@ -42,7 +42,7 @@ declare let coerceStringToStructure: typeof coerceStringToStructure$1;
42
42
  declare let coerceBody: typeof coerceBody$1;
43
43
  declare let hasTypes: typeof hasTypes$1;
44
44
  declare let HasCodec: typeof HasCodec$1;
45
- declare let Intersect: typeof Intersect$1;
45
+ declare let Intersect: typeof Intersect$2;
46
46
  declare let Default: typeof Default$1;
47
47
  declare let Ref: typeof Ref$1;
48
48
  declare let Clone: typeof Clone$1;
@@ -17,7 +17,7 @@ declare const ELYSIA_TYPES: {
17
17
  readonly NoValidate: 15;
18
18
  };
19
19
  type ELYSIA_TYPES = typeof ELYSIA_TYPES;
20
- declare const primitiveElysiaTypes: Set<2 | 1 | 6 | 3 | 10 | 11 | 13 | 14>;
20
+ declare const primitiveElysiaTypes: Set<1 | 2 | 6 | 3 | 10 | 11 | 13 | 14>;
21
21
  declare const noEnumerable: {
22
22
  readonly enumerable: false;
23
23
  };
@@ -2,8 +2,8 @@ import { TypeBoxValidatorCache } from "./validator-cache.js";
2
2
  import { Validator as Validator$1, ValidatorOptions } from "../../validator/index.js";
3
3
  import { MaybePromise } from "../../types.js";
4
4
  import { Static, StaticDecode, StaticEncode, TAny, TSchema } from "typebox/type";
5
- import { TLocalizedValidationError } from "typebox/error";
6
5
  import { Validator } from "typebox/schema";
6
+ import { TLocalizedValidationError } from "typebox/error";
7
7
 
8
8
  //#region src/type/validator/index.d.ts
9
9
  declare function shallowMergeObjects(members: any[]): TSchema | null;
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { AnyLocalHook, AppHook, ElysiaFormData, EventFn, EventScope, GuardSchemaType, InputSchema, Macro, MaybeArray, Prettify, SSEPayload } from "./types.js";
2
2
  import { Context } from "./context.js";
3
3
  import { AnySchema, StandardSchemaV1Like } from "./type/types.js";
4
-
5
4
  //#region src/utils.d.ts
6
5
  declare const nullObject: () => any;
7
6
  type DeriveEntry = Function | readonly [Function, 'mapDerive'];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elysia",
3
3
  "description": "Ergonomic Framework for Human",
4
- "version": "2.0.0-exp.44",
4
+ "version": "2.0.0-exp.45",
5
5
  "author": {
6
6
  "name": "saltyAom",
7
7
  "url": "https://github.com/SaltyAom",