case-to-case
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Installation (Try it on StackBlitz)

npm i case-to-case

Using

import { CaseToCase } from 'case-to-case'

const string = new CaseToCase()
const stringInAnyCase = 'helloWorld'

// Bring a string to a specific case
string.toCamelCase(stringInAnyCase) // ➡️ helloWorld
string.toLowerCase(stringInAnyCase) // ➡️ hello-world
string.toLowerKebabCase(stringInAnyCase) // ➡️ hello-world
string.toPascalCase(stringInAnyCase) // ➡️ HelloWorld
string.toUpperCase(stringInAnyCase) // ➡️ HELLO-WORLD
string.toUpperKebabCase(stringInAnyCase) // ➡️ HELLO-WORLD
string.toUpperSnakeCase(stringInAnyCase) // ➡️ HELLO_WORLD

// Is Case
string.isCamelCase(stringInAnyCase) // ➡️ true
string.isLowerCase(stringInAnyCase) // ➡️ false
string.isLowerKebabCase(stringInAnyCase) // ➡️ false
string.isLowerSnakeCase(stringInAnyCase) // ➡️ false
string.isUpperCase(stringInAnyCase) // ➡️ false
string.isUpperKebabCase(stringInAnyCase) // ➡️ false
string.isUpperSnakeCase(stringInAnyCase) // ➡️ false

// Define Case
string.defineCase(stringInAnyCase) // ➡️ camelCase

Package Sidebar

Install

npm i case-to-case

Weekly Downloads

6

Version

1.2.0

License

ISC

Unpacked Size

16.9 kB

Total Files

12

Last publish

Collaborators

  • zharinov-nikita