1.0.9 • Published 6 years ago

@soggybag/justincase v1.0.9

Weekly downloads
12
License
MIT
Repository
github
Last release
6 years ago

justIncase

GitHub commit activity FooBar npm GitHub package.json version npm bundle size install size Build Status Coverage Status

A library of string functions to help managing case.

API

Table of Contents

capitalize

Capitalize first letter

Returns any String

capitalizeAll

Capitalize all

Returns any String

allCaps

Alias for toUpperCase()

Returns any String

Code samples

let hello = "Hello World"
let foo = "foo bar"

Capitalize the first letter of a string

console.log(hello.capitalize()) // Hello World
console.log(foo.capitalize())	  // Foo bar

Capitalize the first letter of all words in a string

console.log(foo.capitalizeAll()) // Foo Bar

Alternate case in a string, odd characters will be upper

console.log(foo.oddCaps())   // fOo bAr
console.log(hello.oddCaps()) // HElLo WOrLd

Alternate cae with even characters upper

console.log(foo.evenCaps())  // FoO BaR

Replace all spaces with a hyphen "-"

console.log(hello.kabobCase()) // Hello-World
console.log(foo.kabobCase())   // foo-bar

Replaces all spaces with an underscore "_"

console.log(hello.snakeCase()) // Hello_World
console.log(foo.snakeCase())   // foo_bar
1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago