Trims leading/trailing blank lines and removes the common leading indentation from each line.
Uses the minimum indentation of non-blank lines, counted in whitespace characters.
Useful for cleaning up indented template literals.
Parameters
text: string
The text to dedent.
Returns string
The trimmed and dedented text.
Remarks
Whitespace-only lines do not contribute to indentation and become empty strings.
Tabs and spaces each count as one character; no tab expansion is performed.
Normalizes LF and CRLF to LF; preserves trailing whitespace on non-blank lines.
Trims leading/trailing blank lines and removes the common leading indentation from each line.
Uses the minimum indentation of non-blank lines, counted in whitespace characters. Useful for cleaning up indented template literals.