Trims leading/trailing blank lines and removes the common leading indentation from each line.
Computes the minimum indentation across all non-empty lines, then strips that
many leading whitespace characters from every line. Useful for cleaning up
indented template literals.
Parameters
text: string
The text to dedent.
Returns string
The trimmed and dedented text.
Remarks
Empty lines (whitespace-only) do not contribute to the common indent calculation
and become empty strings in the output. Mixed tabs and spaces are treated as
individual characters; no tab-width expansion is performed.
Trims leading/trailing blank lines and removes the common leading indentation from each line.
Computes the minimum indentation across all non-empty lines, then strips that many leading whitespace characters from every line. Useful for cleaning up indented template literals.