osh-text
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

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() replaces searchValue with replaceValue.

Helpers

function intersperse(array: TChildren[], separator: TChildren): TChildren[];
  • intersperse() intersperses separator between elements of an array.

Readme

Keywords

Package Sidebar

Install

npm i osh-text

Weekly Downloads

0

Version

0.4.0

License

MIT

Last publish

Collaborators

  • localvoid