feat(cli): mentions target user
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export function normalizeHandle(input?: string | null): string | null {
|
||||
const raw = (input ?? '').trim();
|
||||
if (!raw) return null;
|
||||
|
||||
const withoutAt = raw.startsWith('@') ? raw.slice(1) : raw;
|
||||
const handle = withoutAt.trim();
|
||||
if (!handle) return null;
|
||||
|
||||
// X/Twitter handles are traditionally max 15 chars; keep strict to avoid surprising queries.
|
||||
if (!/^[A-Za-z0-9_]{1,15}$/.test(handle)) return null;
|
||||
|
||||
return handle;
|
||||
}
|
||||
Reference in New Issue
Block a user