casey-js
v1.7.1
Published
A string utility module that handles all cases gracefully.
Downloads
198
Maintainers
Readme
CaseyJS
A string utility module that handles all cases gracefully.
Installation
Install the package with npm:
npm install casey-js
Include it in your project:
import casey from "casey-js";
Documentation
isString(any)
Returns true if the passed argument is a string or a string object. Otherwise, returns false.
isLowerCase(string)
Returns true if the string is in lower case. Otherwise, returns false.
isUpperCase(string)
Returns true if the string is in upper case. Otherwise, returns false.
isCamelCase(string)
Returns true if the string is in camel case. Otherwise, returns false.
isPascalCase(string)
Returns true if the string is in pascal case. Otherwise, returns false.
isKebabCase(string)
Returns true if the string is in kebab case. Otherwise, returns false.
isSnakeCase(string)
Returns true if the string is in snake case. Otherwise, returns false.
isTrainCase(string)
Returns true if the string is in train case. Otherwise, returns false.
caseOf(string)
Determines the case of the string and returns its name, e.g. CAMEL_CASE. If the string does not match any case, returns null.
toLowerCase(string)
Returns lower-cased string, e.g. foobar.
toUpperCase(string)
Returns upper-cased string, e.g. FOOBAR.
toCamelCase(string)
Returns camel-cased string, e.g. fooBar.
toPascalCase(string)
Returns pascal-cased string, e.g. FooBar.
toKebabCase(string)
Returns kebab-cased string, e.g. foo-bar.
toSnakeCase(string)
Returns snake-cased string, e.g. foo_bar.
toTrainCase(string)
Returns train-cased string, e.g. Foo-Bar.