refactor: trim gateway helper exports

This commit is contained in:
Peter Steinberger
2026-05-02 04:06:03 +01:00
parent 82c11deaa2
commit 1dd5fea759
4 changed files with 4 additions and 5 deletions

View File

@@ -31,7 +31,7 @@ export function isChatStopCommandText(text: string): boolean {
return isAbortRequestText(text);
}
export function resolveChatRunExpiresAtMs(params: {
function resolveChatRunExpiresAtMs(params: {
now: number;
timeoutMs: number;
graceMs?: number;

View File

@@ -8,7 +8,6 @@ import {
export {
hasGatewayPasswordEnvCandidate,
hasGatewayTokenEnvCandidate,
trimCredentialToUndefined,
trimToUndefined,
} from "./credential-planner.js";

View File

@@ -1,7 +1,7 @@
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { trimToUndefined, type ExplicitGatewayAuth } from "./credentials.js";
export function hasExplicitGatewayConnectionAuth(auth?: ExplicitGatewayAuth): boolean {
function hasExplicitGatewayConnectionAuth(auth?: ExplicitGatewayAuth): boolean {
return Boolean(trimToUndefined(auth?.token) || trimToUndefined(auth?.password));
}

View File

@@ -43,7 +43,7 @@ function normalizeTailnetHostForUrl(rawHost: string): string | null {
return trimmed;
}
export function buildTailnetHttpsOrigin(rawHost: string): string | null {
function buildTailnetHttpsOrigin(rawHost: string): string | null {
const normalizedHost = normalizeTailnetHostForUrl(rawHost);
if (!normalizedHost) {
return null;
@@ -55,7 +55,7 @@ export function buildTailnetHttpsOrigin(rawHost: string): string | null {
}
}
export function appendAllowedOrigin(existing: string[] | undefined, origin: string): string[] {
function appendAllowedOrigin(existing: string[] | undefined, origin: string): string[] {
const current = existing ?? [];
const normalized = normalizeLowercaseStringOrEmpty(origin);
if (current.some((entry) => normalizeLowercaseStringOrEmpty(entry) === normalized)) {