Interface WrapperOptions

Hierarchy

  • WrapperOptions

Properties

escape: undefined | EscapeString

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.

indent: undefined | string | number

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).

indentChar: undefined | string

If indent is a number, use that many of this string to indent. Defaults to " " (a single space).

indentEmpty: undefined | boolean

If the input string is empty, should we still indent? Defaults to false

indentFirst: undefined | boolean

Indent the first line? Defaults to true.

isEmpty: undefined | RegExp

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.

isNewline: undefined | RegExp

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.

locale: undefined | string

Which locale to use when splitting by words or graphemes? Defaults to current locale of system, as calculated by the JS runtime.

newline: undefined | string

String to insert at the end of every line, including the last one. Defaults to "\n".

newlineReplacement: undefined | string

For every newline found with isNewline, insert this string. Defaults to " " (single space).

trim: undefined | boolean

Trim empty space from the end of the input. Defaults to true.

width: undefined | number

Maximum number of graphemes per line, including indentation. Defaults to 80.

Generated using TypeDoc