peach a19a732be8 commit message | vor 2 Jahren | |
---|---|---|
.. | ||
dist | vor 2 Jahren | |
CHANGELOG.md | vor 2 Jahren | |
LICENSE | vor 2 Jahren | |
README.md | vor 2 Jahren | |
package.json | vor 2 Jahren |
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 preservedcamelCase
Splits string and joins by camelCase convention (foo-bar
=> fooBar
)
kebabCase(str)
Splits string and joins by kebab-case convention (fooBar
=> foo-bar
)
Remarks:
snakeCase
Splits 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?)
['-', '_', '/', '.]
)