The best way to control Claude Code, Codex and more from any computer or phone

main
ts 9 lines 358 Bytes
Raw
1 export function field(source: unknown, key: string): unknown {
2 return typeof source === "object" && source !== null ? Reflect.get(source, key) : undefined;
3 }
4
5 export function text(value: unknown): string | undefined {
6 if (typeof value !== "string") return undefined;
7 const trimmed = value.trim();
8 return trimmed.length === 0 ? undefined : trimmed;
9 }