osh-text
v0.4.0
Published
General purpose text utilities for osh library
Downloads
23
Readme
General purpose text utilities utilities for osh library.
Transformers
function trim(...children: TChildren[]): TransformNode;
function trimLeft(...children: TChildren[]): TransformNode;
function trimRight(...children: TChildren[]): TransformNode;
function toLowerCase(...children: TChildren[]): TransformNode;
function toUpperCase(...children: TChildren[]): TransformNode;
function capitalize(...children: TChildren[]): TransformNode;
function replace(searchValue: string | RegExp, replaceValue: string, ...children: TChildren[]): TransformNode;
trim()
trims whitespaces from a string.trimLeft()
trims whitespaces at the start of a string.trimRight()
trims whitespaces at the end of a string.toLowerCase()
converts string to lower case.toUpperCase()
converts string to upper case.capitalize()
capitalizes first character of a string.replace()
replacessearchValue
withreplaceValue
.
Helpers
function intersperse(array: TChildren[], separator: TChildren): TChildren[];
intersperse()
interspersesseparator
between elements of anarray
.