Flags for Width output options
Options for line endings
If false and input string has BOM then the BOM will be added as the first byte of output. BOM will not be counted in the width of the first line. If false the return value will not have BOM included. Default true
If true extra spaces will be removed from the output. Default false
Option to break string. Width, word, eol
Width to break string at. Default 80
Generated using TypeDoc
Options for stringBreaker
Example to split string contains elemets of 10
const opt: IStringBreakOpt = { width: 10 }
Example to split string contains elemets of 40 and encode line endings into \n
const opt: IStringBreakOpt = { width: 40, lnEnd: lnEndOpt.encode }
Example to split string contains elemets of 40 and keep Byte order mark if it exist
const opt: IStringBreakOpt = { width: 40, noBOM: false }
Example to split string contains one element per line
const opt: IStringBreakOpt = { splitOpt: splitByOpt.line }
Example to split string contains one element per word
const opt: IStringBreakOpt = { splitOpt: splitByOpt.word }
Example to split string contains elemets base up if the character is fullwidth or halfwidth.
Fullwidth chars would take up two positions in the element.
Halfwidth chars would take up one postion in the element.
const opt: IStringBreakOpt = { width: 40, lenOpt: widthFlags.fullwidth }
Example to split string contains elemets base up if the character is a surrogate pair.
Surrogate pair chars would take up two positions in the element.
const opt: IStringBreakOpt = { width: 40, lenOpt: widthFlags.surrogatePair }
Example to split string contains elemets base up if the character is fullwidth, halfwidth or surrogate pair.
Fullwidth chars would take up two positions in the element.
Halfwidth chars would take up one postion in the element.
Surrogate pair chars would take up two positions in the element.
const opt: IStringBreakOpt = { width: 100, lenOpt: widthFlags.fullwidth | widthFlags.surrogatePair }