Removes the common indentation from a block of text.
Strips the longest leading whitespace sequence shared by all non-blank lines, so text laid out to match the indentation of the surrounding code reads as if written flush left:
\r\n, \r, \n) are normalised to \nText whose lines share no leading whitespace keeps its indentation, aside from these normalisations.
Margins are compared as character sequences rather than as visual widths, so a tab never matches a run of spaces, even where the two render to the same width.
The indented string to realign
A copy of string with the line terminators normalised, the outer blank lines dropped and the shared
leading whitespace removed from every line
Removes the common indentation from a template literal.
Assembles the template exactly as the literal itself would, converting interpolated values to strings and splicing them into the literal sections, then strips the shared margin from the result under the same rules as the plain text form. Since values are spliced in before the margin is computed, multi-line values take part in the computation like any other text and a value whose continuation lines are flush left suppresses the dedent; a tagged call and a plain call on the same literal therefore return the same result.
The literal sections of the template
The values interpolated between the literal sections
The assembled template with the line terminators normalised, the outer blank lines dropped and the shared leading whitespace removed from every line
Removes the common indentation from a block of text or a template literal.