0.4.0 • Published 7 years ago
osh-string v0.4.0
String 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
.
0.4.0
7 years ago