@gravitywelluk/string-manipulation
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Gravitywell String-manipulation

Library of utility functions to manipulate strings

CI License Downloads Version


Table of Contents

Usage

import { <LIB_NAME_HERE> } from "@gravitywelluk/string-manipulation";

punctuate

Checks if the given string has the request punctuation mark and adds it to the string if it does not.

import { punctuate, PunctuationMark } from "@gravitywelluk/string-manipulation";

punctuate("The quick brown fox jumps over the lazy dog", PunctuationMark.FULL_STOP);
// Output: "The quick brown fox jumps over the lazy dog."

sentenceCase

Converts a strings 1st letter to uppercase

import { sentenceCase } from "@gravitywelluk/string-manipulation";

sentenceCase("the fox JUMPED over Brian's lazy dog");
// Output: "The fox JUMPED over Brian's lazy dog"

slurlgify

Converts the given slug into a slugified URL

import { slurlgify } from "@gravitywelluk/string-manipulation";

slurlgify("the fox JUMPED over Brian's lazy dog & cat + mouse");
// Output: "the-fox-jumped-over-brians-lazy-dog-and-cat-plus-mouse"

titleCase

Converts the given sentence string into title case

import { titleCase } from "@gravitywelluk/string-manipulation";

titleCase("the fox JUMPED over brian's lazy dog");
// Output: "The Fox Jumped over Brian's Lazy Dog"

Package Sidebar

Install

npm i @gravitywelluk/string-manipulation

Weekly Downloads

7

Version

1.1.1

License

MIT

Unpacked Size

11.5 kB

Total Files

15

Last publish

Collaborators

  • gravitywell.uk