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;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-04)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.