Package Exports
- case-modifier
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (case-modifier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
case-modifier
Convert string to target CaseType, like: camelCase, snakeCase, properCase, constantCase
Install
npm i case-modifierUsage
import * as CaseModifier from 'case-modifier'
// type: camelCase
CaseModifier.CASE_CAMEL
CaseModifier.camelCase('we-will-rock-the-word') // weWillRockTheWord
// type: snakeCase
CaseModifier.CASE_SNAKE
CaseModifier.snakeCase('we-will-rock-the-word') // we_will_rock_the_word
// type: kebabCase
CaseModifier.CASE_KEBAB
CaseModifier.CASE_DASH
CaseModifier.kebabCase('WeWillRockTheWord') // we-will-rock-the-word
// type: properCase
CaseModifier.CASE_PROPER
CaseModifier.CASE_PASCAL
CaseModifier.properCase('we-will-rock-the-word') // WeWillRockTheWord
// type: constantCase
CaseModifier.CASE_CONSTANT
CaseModifier.constantCase('WeWillRockTheWord') // WE_WILL_ROCK_THE_WORD
// covert(str, caseType)
CaseModifier.convert('we-will-rock-the-word') // weWillRockTheWord
CaseModifier.convert('we-will-rock-the-word', CaseModifier.CASE_PROPER) // WeWillRockTheWord
// if not support, just return source string
CaseModifier.convert('We will rock the word') // We will rock the word