style: tidy cli formatting

This commit is contained in:
Peter Steinberger
2026-01-08 08:24:57 +01:00
parent c7cade5232
commit 5b397c0f15
7 changed files with 25 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
import { loadConfig } from "../config/config.js";
import { setVerbose } from "../globals.js";
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
import { loginWeb, logoutWeb } from "../provider-web.js";
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
import { resolveWhatsAppAccount } from "../web/accounts.js";
type ProviderAuthOptions = {
@@ -11,7 +11,9 @@ type ProviderAuthOptions = {
};
function normalizeProvider(raw?: string): "whatsapp" | "web" {
const value = String(raw ?? "whatsapp").trim().toLowerCase();
const value = String(raw ?? "whatsapp")
.trim()
.toLowerCase();
if (value === "whatsapp" || value === "web") return value;
throw new Error(`Unsupported provider: ${value}`);
}
@@ -36,7 +38,7 @@ export async function runProviderLogout(
opts: ProviderAuthOptions,
runtime: RuntimeEnv = defaultRuntime,
) {
const provider = normalizeProvider(opts.provider);
const _provider = normalizeProvider(opts.provider);
// Auth-only flow: resolve account + clear session state only.
const cfg = loadConfig();
const account = resolveWhatsAppAccount({