Package Exports
- scule
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 (scule) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🧵 Scule
Install
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
Utils
pascalCase(str)
Splits string and joins by PascalCase convention (foo-bar
=> FooBar
)
Remarks:
- If an upper case if followed by other upper case chars (like
FooBAR
), it is preserved
camelCase
Splits string and joins by camelCase convention (foo-bar
=> fooBar
)
kebabCase(str)
Splits string and joins by kebab-case convention (fooBar
=> foo-bar
)
Remarks:
- It does not preserves case
snakeCase
Splits string and joins by snake_case convention (foo-bar
=> foo_bar
)
upperFirst(str)
Converts first charachter to upper case
lowerFirst(str)
Converts first charachter to lower case
splitByCase(str, splitters?)
- Splits string by splitters (default:
['-', '_', '/', '.]
) - Splits when case changes from lower to upper (only rising edges)
- Case is preserved in returned value
- Is an irreversible function since splitters are omitted