mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:02:44 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -10,8 +10,7 @@ export const GATEWAY_CLIENT_IDS = {
|
||||
PROBE: "clawdbot-probe",
|
||||
} as const;
|
||||
|
||||
export type GatewayClientId =
|
||||
(typeof GATEWAY_CLIENT_IDS)[keyof typeof GATEWAY_CLIENT_IDS];
|
||||
export type GatewayClientId = (typeof GATEWAY_CLIENT_IDS)[keyof typeof GATEWAY_CLIENT_IDS];
|
||||
|
||||
// Back-compat naming (internal): these values are IDs, not display names.
|
||||
export const GATEWAY_CLIENT_NAMES = GATEWAY_CLIENT_IDS;
|
||||
@@ -26,8 +25,7 @@ export const GATEWAY_CLIENT_MODES = {
|
||||
TEST: "test",
|
||||
} as const;
|
||||
|
||||
export type GatewayClientMode =
|
||||
(typeof GATEWAY_CLIENT_MODES)[keyof typeof GATEWAY_CLIENT_MODES];
|
||||
export type GatewayClientMode = (typeof GATEWAY_CLIENT_MODES)[keyof typeof GATEWAY_CLIENT_MODES];
|
||||
|
||||
export type GatewayClientInfo = {
|
||||
id: GatewayClientId;
|
||||
@@ -40,16 +38,10 @@ export type GatewayClientInfo = {
|
||||
instanceId?: string;
|
||||
};
|
||||
|
||||
const GATEWAY_CLIENT_ID_SET = new Set<GatewayClientId>(
|
||||
Object.values(GATEWAY_CLIENT_IDS),
|
||||
);
|
||||
const GATEWAY_CLIENT_MODE_SET = new Set<GatewayClientMode>(
|
||||
Object.values(GATEWAY_CLIENT_MODES),
|
||||
);
|
||||
const GATEWAY_CLIENT_ID_SET = new Set<GatewayClientId>(Object.values(GATEWAY_CLIENT_IDS));
|
||||
const GATEWAY_CLIENT_MODE_SET = new Set<GatewayClientMode>(Object.values(GATEWAY_CLIENT_MODES));
|
||||
|
||||
export function normalizeGatewayClientId(
|
||||
raw?: string | null,
|
||||
): GatewayClientId | undefined {
|
||||
export function normalizeGatewayClientId(raw?: string | null): GatewayClientId | undefined {
|
||||
const normalized = raw?.trim().toLowerCase();
|
||||
if (!normalized) return undefined;
|
||||
return GATEWAY_CLIENT_ID_SET.has(normalized as GatewayClientId)
|
||||
@@ -57,15 +49,11 @@ export function normalizeGatewayClientId(
|
||||
: undefined;
|
||||
}
|
||||
|
||||
export function normalizeGatewayClientName(
|
||||
raw?: string | null,
|
||||
): GatewayClientName | undefined {
|
||||
export function normalizeGatewayClientName(raw?: string | null): GatewayClientName | undefined {
|
||||
return normalizeGatewayClientId(raw);
|
||||
}
|
||||
|
||||
export function normalizeGatewayClientMode(
|
||||
raw?: string | null,
|
||||
): GatewayClientMode | undefined {
|
||||
export function normalizeGatewayClientMode(raw?: string | null): GatewayClientMode | undefined {
|
||||
const normalized = raw?.trim().toLowerCase();
|
||||
if (!normalized) return undefined;
|
||||
return GATEWAY_CLIENT_MODE_SET.has(normalized as GatewayClientMode)
|
||||
|
||||
Reference in New Issue
Block a user