buildPatternTrimEnd
buildPatternTrimEnd(
pattern?): (string) =>string
Defined in: packages/core/src/pattern/pattern-trim.ts:50
Creates a function that trims the specified pattern from the end of a string. Prefer this over patternTrimEnd when trimming the same pattern repeatedly, as the regex is compiled once.
Parameters
Section titled “Parameters”pattern?
Section titled “pattern?”string
The pattern to trim. If not provided, whitespace and line terminators are trimmed.
Returns
Section titled “Returns”A function that trims the pattern from the end of a string.
(string) => string