zharinov-nikita / case-to-case

Edit and define case strings

Home Page:https://www.npmjs.com/package/case-to-case

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Edit and define case strings

https://www.npmjs.com/package/case-to-case


Languages

Language:TypeScript 97.9%Language:JavaScript 1.2%Language:Shell 1.0%