Remove origin's indentation.
Samples:
// Remove indentation from a text with 2 spaces.
const script = unindent`
param:
second_params: 3
`; // => "param:\n second_params: 3\n"
// Change indentation to 4 spaces
const script = unindent(4)`
param:
second_params: 3
`; // => " param:\n second_params: 3\n"
unindent`text multiline`; // => string
unindent(indentSize)`text multiline`; // => string
unindent(textMultiline); // => string
unindent(indentSize, textMultiline); // => string
Parameters
-
text multiline
: Can be used theunindent
function as a tagged template. -
indentSize
(number): define the new indentation to the text. -
textMultiline
(string): text to remove indentation
Return value
A string formatted.