refactor: dedupe extension string record helpers

This commit is contained in:
Peter Steinberger
2026-04-07 00:32:39 +01:00
parent a88f240311
commit f178a9dc41
4 changed files with 11 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ import {
import { VerificationMethod } from "matrix-js-sdk/lib/types.js";
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/core";
import type { PinnedDispatcherPolicy } from "openclaw/plugin-sdk/infra-runtime";
import { normalizeNullableString } from "openclaw/plugin-sdk/text-runtime";
import type { SsrFPolicy } from "../runtime-api.js";
import { resolveMatrixRoomKeyBackupReadinessError } from "./backup-health.js";
import { FileBackedMatrixSyncStore } from "./client/file-sync-store.js";
@@ -173,10 +174,7 @@ async function loadMatrixCryptoRuntime(): Promise<MatrixCryptoRuntime> {
return await matrixCryptoRuntimePromise;
}
function normalizeOptionalString(value: string | null | undefined): string | null {
const normalized = value?.trim();
return normalized ? normalized : null;
}
const normalizeOptionalString = normalizeNullableString;
function isUnsupportedAuthenticatedMediaEndpointError(err: unknown): boolean {
const statusCode = (err as { statusCode?: number })?.statusCode;