Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import type { ActiveChannelPluginRuntimeShape } from "../../plugins/channel-registry-state.types.js";
import { getActivePluginChannelRegistryFromState } from "../../plugins/runtime-channel-state.js";
import { normalizeOptionalString } from "../../shared/string-coerce.js";
import type { ChannelPlugin } from "./types.plugin.js";
import type { ChannelId } from "./types.public.js";
function coerceLoadedChannelPlugin(
plugin: ActiveChannelPluginRuntimeShape | null | undefined,
): ChannelPlugin | undefined {
const id = normalizeOptionalString(plugin?.id) ?? "";
if (!plugin || !id) {
return undefined;
}
if (!plugin.meta || typeof plugin.meta !== "object") {
plugin.meta = {};
}
return plugin as ChannelPlugin;
}
export function getLoadedChannelPluginForRead(id: ChannelId): ChannelPlugin | undefined {
const resolvedId = normalizeOptionalString(id) ?? "";
if (!resolvedId) {
return undefined;
}
const registry = getActivePluginChannelRegistryFromState();
if (!registry || !Array.isArray(registry.channels)) {
return undefined;
}
for (const entry of registry.channels) {
const plugin = coerceLoadedChannelPlugin(entry?.plugin);
if (plugin && plugin.id === resolvedId) {
return plugin;
}
}
return undefined;
}
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland