mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-01 18:48:16 +00:00
fix(gateway): satisfy server-method lint
This commit is contained in:
@@ -46,7 +46,15 @@ import { resolveSessionKeyFromResolveParams } from "../sessions-resolve.js";
|
|||||||
import { assertValidParams } from "./validation.js";
|
import { assertValidParams } from "./validation.js";
|
||||||
|
|
||||||
function requireSessionKey(key: unknown, respond: RespondFn): string | null {
|
function requireSessionKey(key: unknown, respond: RespondFn): string | null {
|
||||||
const normalized = String(key ?? "").trim();
|
const raw =
|
||||||
|
typeof key === "string"
|
||||||
|
? key
|
||||||
|
: typeof key === "number"
|
||||||
|
? String(key)
|
||||||
|
: typeof key === "bigint"
|
||||||
|
? String(key)
|
||||||
|
: "";
|
||||||
|
const normalized = raw.trim();
|
||||||
if (!normalized) {
|
if (!normalized) {
|
||||||
respond(false, undefined, errorShape(ErrorCodes.INVALID_REQUEST, "key required"));
|
respond(false, undefined, errorShape(ErrorCodes.INVALID_REQUEST, "key required"));
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { randomUUID } from "node:crypto";
|
import { randomUUID } from "node:crypto";
|
||||||
import type { GatewayRequestHandlers, RespondFn } from "./types.js";
|
import type { GatewayRequestHandlers } from "./types.js";
|
||||||
import { defaultRuntime } from "../../runtime.js";
|
import { defaultRuntime } from "../../runtime.js";
|
||||||
import { WizardSession } from "../../wizard/session.js";
|
import { WizardSession } from "../../wizard/session.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
Reference in New Issue
Block a user