Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9 lines
194 B
TypeScript
9 lines
194 B
TypeScript
export function firstNonEmptyLine(text: string): string {
|
|
return (
|
|
text
|
|
.split(/\r?\n/)
|
|
.map((line) => line.trim())
|
|
.find(Boolean) ?? ""
|
|
);
|
|
}
|