If a string, indent every line with that
string. If a number, insert that many indentChars at the beginning of
each line. Defaults to ""
(the empty string).
If indent is a number, use that many of
this string to indent. Defaults to " "
(a single space).
If the input string is empty, should we
still indent? Defaults to false
Indent the first line? Defaults to true
.
Regular expression to test if a segment
contains nothing but spaces. Make sure to include '^' at the beginning
and '$' at the end. Defaults to /^\s*$/u
.
Regular expression that finds newlines for replacement with
newlineReplacement
. Ensure you do not create a regular expression
denial of service
(ReDoS)
attack. Make sure the expression has the \g
modifier. Defaults to
/((?![\r\n\v\f\x85\u2028\u2029])\s)*[\r\n\v\f\x85\u2028\u2029]+(\s*)/gu
.
Which locale to use when splitting by words or graphemes? Defaults to current locale of system, as calculated by the JS runtime.
String to insert at the end of every line,
including the last one. Defaults to "\n"
.
For every newline found with
isNewline, insert this string. Defaults to " "
(single space).
Trim empty space from the end of the input.
Defaults to true
.
Maximum number of graphemes per line, including
indentation. Defaults to 80
.
Generated using TypeDoc
Function to escape the input string. The escaping is performed after line breaking, with the intent that in the final display, those escapes will be replaced appropriately. Defaults to an identity transform.