|
|
3 years ago | |
|---|---|---|
| .. | ||
| dist | 3 years ago | |
| CHANGELOG.md | 3 years ago | |
| LICENSE | 3 years ago | |
| README.md | 3 years ago | |
| package.json | 3 years ago | |
Install using npm or yarn:
npm i scule
# or
yarn add scule
Import:
// CommonJS
const { pascalCase } = require('scule')
// ESM
import { pascalCase } from 'scule'
Notice: You may need to transpile package for legacy environments
pascalCase(str)Splits string and joins by PascalCase convention (foo-bar => FooBar)
Remarks:
FooBAR), they are preservedcamelCaseSplits string and joins by camelCase convention (foo-bar => fooBar)
kebabCase(str)Splits string and joins by kebab-case convention (fooBar => foo-bar)
Remarks:
snakeCaseSplits string and joins by snake_case convention (foo-bar => foo_bar)
upperFirst(str)Converts first character to upper case
lowerFirst(str)Converts first character to lower case
splitByCase(str, splitters?)['-', '_', '/', '.])