elysia 2.0.0-exp.31 → 2.0.0-exp.32
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.
- package/dist/base.js +1 -20
- package/dist/base.mjs +1 -20
- package/dist/compile/lexer.d.ts +1 -1
- package/package.json +1 -1
package/dist/base.js
CHANGED
|
@@ -4,7 +4,6 @@ const require_universal_constants = require('./universal/constants.js');
|
|
|
4
4
|
const require_constants = require('./constants.js');
|
|
5
5
|
const require_utils = require('./utils.js');
|
|
6
6
|
const require_type_bridge = require('./type/bridge.js');
|
|
7
|
-
const require_error = require('./error.js');
|
|
8
7
|
const require_compile_aot = require('./compile/aot.js');
|
|
9
8
|
const require_compile_handler_index = require('./compile/handler/index.js');
|
|
10
9
|
const require_ws_route = require('./ws/route.js');
|
|
@@ -1082,21 +1081,6 @@ var Elysia = class Elysia {
|
|
|
1082
1081
|
this.#initMap();
|
|
1083
1082
|
const methods = this["~map"];
|
|
1084
1083
|
const length = this.#history.length;
|
|
1085
|
-
let hasDuplicate = false;
|
|
1086
|
-
const seen = /* @__PURE__ */ new Map();
|
|
1087
|
-
for (let i = 0; i < length; i++) {
|
|
1088
|
-
const route = this.#history[i];
|
|
1089
|
-
const m = route[0] === "WS" ? "WS" : require_utils.mapMethodBack(route[0]);
|
|
1090
|
-
const key = m + " " + route[1];
|
|
1091
|
-
if (this.#routeMayHaveModelRef(route)) this.#assertRouteModelRefs(route, m);
|
|
1092
|
-
if (seen.has(key)) {
|
|
1093
|
-
hasDuplicate = true;
|
|
1094
|
-
if (!require_error.isProduction()) {
|
|
1095
|
-
if (this.#history[seen.get(key)][2] !== route[2]) console.warn(`[Elysia] Duplicate route ${key} at`, (/* @__PURE__ */ new Error()).stack);
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
seen.set(key, i);
|
|
1099
|
-
}
|
|
1100
1084
|
let explicitHead;
|
|
1101
1085
|
if (enableAutoHead) {
|
|
1102
1086
|
for (let i = 0; i < length; i++) if (require_utils.mapMethodBack(this.#history[i][0]) === "HEAD") (explicitHead ??= /* @__PURE__ */ new Set()).add(this.#history[i][1]);
|
|
@@ -1123,10 +1107,7 @@ var Elysia = class Elysia {
|
|
|
1123
1107
|
const route = this.#history[i];
|
|
1124
1108
|
const method = require_utils.mapMethodBack(route[0]);
|
|
1125
1109
|
const path = route[1];
|
|
1126
|
-
if (
|
|
1127
|
-
const key = (route[0] === "WS" ? "WS" : method) + " " + path;
|
|
1128
|
-
if (seen.get(key) !== i) continue;
|
|
1129
|
-
}
|
|
1110
|
+
if (this.#routeMayHaveModelRef(route)) this.#assertRouteModelRefs(route, method);
|
|
1130
1111
|
if (route[0] === "WS") {
|
|
1131
1112
|
const ws = require_ws_route.buildWSRoute(route, this);
|
|
1132
1113
|
const handler = ws[0];
|
package/dist/base.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import { isBun } from "./universal/constants.mjs";
|
|
|
2
2
|
import { MethodMap, isDynamicRegex, needEncodeRegex } from "./constants.mjs";
|
|
3
3
|
import { clonePlainDecorators, clonePlainDeep, coalesceStandaloneSchemas, createErrorEventHandler, eventProperties, fnOrigin, fnv1a, getLoosePath, guardNonPlainLeaves, hookToGuard, invalidateMacroEpoch, isEmpty, isNotEmpty, isRecordNumber, joinPath, macroOrigin, mapMethodBack, mergeDeep, mergeResponse, nullObject, pushField, schemaProperties, serializeMacroSeed } from "./utils.mjs";
|
|
4
4
|
import { Ref } from "./type/bridge.mjs";
|
|
5
|
-
import { isProduction } from "./error.mjs";
|
|
6
5
|
import { Capture } from "./compile/aot.mjs";
|
|
7
6
|
import { compileHandler, composeRouteHook, localMacroRoot, resolveLocalHook } from "./compile/handler/index.mjs";
|
|
8
7
|
import { buildWSRoute } from "./ws/route.mjs";
|
|
@@ -1079,21 +1078,6 @@ var Elysia = class Elysia {
|
|
|
1079
1078
|
this.#initMap();
|
|
1080
1079
|
const methods = this["~map"];
|
|
1081
1080
|
const length = this.#history.length;
|
|
1082
|
-
let hasDuplicate = false;
|
|
1083
|
-
const seen = /* @__PURE__ */ new Map();
|
|
1084
|
-
for (let i = 0; i < length; i++) {
|
|
1085
|
-
const route = this.#history[i];
|
|
1086
|
-
const m = route[0] === "WS" ? "WS" : mapMethodBack(route[0]);
|
|
1087
|
-
const key = m + " " + route[1];
|
|
1088
|
-
if (this.#routeMayHaveModelRef(route)) this.#assertRouteModelRefs(route, m);
|
|
1089
|
-
if (seen.has(key)) {
|
|
1090
|
-
hasDuplicate = true;
|
|
1091
|
-
if (!isProduction()) {
|
|
1092
|
-
if (this.#history[seen.get(key)][2] !== route[2]) console.warn(`[Elysia] Duplicate route ${key} at`, (/* @__PURE__ */ new Error()).stack);
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
seen.set(key, i);
|
|
1096
|
-
}
|
|
1097
1081
|
let explicitHead;
|
|
1098
1082
|
if (enableAutoHead) {
|
|
1099
1083
|
for (let i = 0; i < length; i++) if (mapMethodBack(this.#history[i][0]) === "HEAD") (explicitHead ??= /* @__PURE__ */ new Set()).add(this.#history[i][1]);
|
|
@@ -1120,10 +1104,7 @@ var Elysia = class Elysia {
|
|
|
1120
1104
|
const route = this.#history[i];
|
|
1121
1105
|
const method = mapMethodBack(route[0]);
|
|
1122
1106
|
const path = route[1];
|
|
1123
|
-
if (
|
|
1124
|
-
const key = (route[0] === "WS" ? "WS" : method) + " " + path;
|
|
1125
|
-
if (seen.get(key) !== i) continue;
|
|
1126
|
-
}
|
|
1107
|
+
if (this.#routeMayHaveModelRef(route)) this.#assertRouteModelRefs(route, method);
|
|
1127
1108
|
if (route[0] === "WS") {
|
|
1128
1109
|
const ws = buildWSRoute(route, this);
|
|
1129
1110
|
const handler = ws[0];
|
package/dist/compile/lexer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/compile/lexer.d.ts
|
|
2
|
-
declare const isSpace: (ch: string) => ch is "
|
|
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;
|