refactor: dedupe cli lowercase helpers

This commit is contained in:
Peter Steinberger
2026-04-07 12:27:55 +01:00
parent 50265c8b1f
commit 978a0a720e
9 changed files with 33 additions and 19 deletions

View File

@@ -1,10 +1,11 @@
import type { Command } from "commander";
import { getChannelPlugin } from "../../../channels/plugins/index.js";
import type { ChannelMessageActionName } from "../../../channels/plugins/types.js";
import { normalizeLowercaseStringOrEmpty } from "../../../shared/string-coerce.js";
import type { MessageCliHelpers } from "./helpers.js";
function resolveThreadCreateRequest(opts: Record<string, unknown>) {
const channel = typeof opts.channel === "string" ? opts.channel.trim().toLowerCase() : "";
const channel = normalizeLowercaseStringOrEmpty(opts.channel);
if (channel) {
const request = getChannelPlugin(channel)?.actions?.resolveCliActionRequest?.({
action: "thread-create",