elysia 2.0.0-exp.57 → 2.0.0-exp.58
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 +2 -3
- package/dist/base.mjs +2 -3
- package/dist/package.js +1 -1
- package/dist/package.mjs +1 -1
- package/package.json +1 -1
package/dist/base.js
CHANGED
|
@@ -1107,8 +1107,6 @@ var Elysia = class Elysia {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
ws(path, optionsOrHandler, handler) {
|
|
1109
1109
|
this["~hasWS"] = true;
|
|
1110
|
-
const adapter = this["~config"]?.adapter;
|
|
1111
|
-
if (!adapter?.websocket && !require_universal_constants.isBun) throw new Error(`[Elysia] WebSocket is not supported on '${adapter?.name ?? "web-standard"}' adapter.`);
|
|
1112
1110
|
let opts;
|
|
1113
1111
|
if (handler !== void 0) {
|
|
1114
1112
|
opts = Object.assign(require_utils.nullObject(), optionsOrHandler);
|
|
@@ -1436,6 +1434,7 @@ var Elysia = class Elysia {
|
|
|
1436
1434
|
const routePath = path[i];
|
|
1437
1435
|
const routeFlags = flags[i];
|
|
1438
1436
|
if ((routeFlags & require_route_table.RouteFlag.WS) !== 0) {
|
|
1437
|
+
if (!wsCap) throw new Error(`[Elysia] WebSocket route ${routeMethod} ${routePath} defined, but no WS capability is available. Ensure that .use(websocket()) is applied.`);
|
|
1439
1438
|
const ws = wsCap.provider.buildWSRoute(require_route_table.routeRow(table, i), this);
|
|
1440
1439
|
const handler = ws[0];
|
|
1441
1440
|
const options = ws[1];
|
|
@@ -1504,7 +1503,7 @@ var Elysia = class Elysia {
|
|
|
1504
1503
|
}
|
|
1505
1504
|
#handle;
|
|
1506
1505
|
get handle() {
|
|
1507
|
-
return this.#handle ??= async (requestOrUrl, options) => this.fetch(typeof requestOrUrl === "string" ? new Request(requestOrUrl.
|
|
1506
|
+
return this.#handle ??= async (requestOrUrl, options) => this.fetch(typeof requestOrUrl === "string" ? new Request(requestOrUrl.charCodeAt(0) === 47 ? `http://e.ly${requestOrUrl}` : requestOrUrl, options) : requestOrUrl);
|
|
1508
1507
|
}
|
|
1509
1508
|
listen(options, callback) {
|
|
1510
1509
|
const listen = (this["~config"]?.adapter ?? (require_universal_constants.isBun ? require_adapter_bun_index.BunAdapter : void 0))?.listen;
|
package/dist/base.mjs
CHANGED
|
@@ -1104,8 +1104,6 @@ var Elysia = class Elysia {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
ws(path, optionsOrHandler, handler) {
|
|
1106
1106
|
this["~hasWS"] = true;
|
|
1107
|
-
const adapter = this["~config"]?.adapter;
|
|
1108
|
-
if (!adapter?.websocket && !isBun) throw new Error(`[Elysia] WebSocket is not supported on '${adapter?.name ?? "web-standard"}' adapter.`);
|
|
1109
1107
|
let opts;
|
|
1110
1108
|
if (handler !== void 0) {
|
|
1111
1109
|
opts = Object.assign(nullObject(), optionsOrHandler);
|
|
@@ -1433,6 +1431,7 @@ var Elysia = class Elysia {
|
|
|
1433
1431
|
const routePath = path[i];
|
|
1434
1432
|
const routeFlags = flags[i];
|
|
1435
1433
|
if ((routeFlags & RouteFlag.WS) !== 0) {
|
|
1434
|
+
if (!wsCap) throw new Error(`[Elysia] WebSocket route ${routeMethod} ${routePath} defined, but no WS capability is available. Ensure that .use(websocket()) is applied.`);
|
|
1436
1435
|
const ws = wsCap.provider.buildWSRoute(routeRow(table, i), this);
|
|
1437
1436
|
const handler = ws[0];
|
|
1438
1437
|
const options = ws[1];
|
|
@@ -1501,7 +1500,7 @@ var Elysia = class Elysia {
|
|
|
1501
1500
|
}
|
|
1502
1501
|
#handle;
|
|
1503
1502
|
get handle() {
|
|
1504
|
-
return this.#handle ??= async (requestOrUrl, options) => this.fetch(typeof requestOrUrl === "string" ? new Request(requestOrUrl.
|
|
1503
|
+
return this.#handle ??= async (requestOrUrl, options) => this.fetch(typeof requestOrUrl === "string" ? new Request(requestOrUrl.charCodeAt(0) === 47 ? `http://e.ly${requestOrUrl}` : requestOrUrl, options) : requestOrUrl);
|
|
1505
1504
|
}
|
|
1506
1505
|
listen(options, callback) {
|
|
1507
1506
|
const listen = (this["~config"]?.adapter ?? (isBun ? BunAdapter : void 0))?.listen;
|
package/dist/package.js
CHANGED
package/dist/package.mjs
CHANGED