jsmp-infra-string-case-styles
v1.0.5
Published
returns string or array in specified style case
Downloads
5
Readme
jsmp-infra-string-case-styles
Transform string or array with strings
Install
npm install jsmp-infra-string-case-styles
usage
const {modifyString, modifyArray} = require( "jsmp-infra-string-case-styles")
or
import {modifyString, modifyArray} from "jsmp-infra-string-case-styles"
modifyArray([array],[type])
Returns an array of elements in specified case
modifyString([string],[type])
Returns a string in specified case
examples
modifyString:
modifyString('Foo Bar','camelCase');
// => 'fooBar'
modifyString('--foo-bar--','camelCase');
// => 'fooBar'
modifyString('FRED','capitalize');
// => 'Fred'
modifyArray:
modifyArray(['Foo Bar', '--foo-bar--', '__FOO_BAR__'], "camelCase")
// => ['fooBar','fooBar','fooBar']
modifyArray(['Foo Bar','fooBar','__FOO_BAR__'], "kebabCase")
// => ['foo-bar','foo-bar','foo-bar']