jsmp-infra-filippov
v1.0.14
Published
Package for cdp module 6
Downloads
18
Readme
An package for cdp module 6 which can convert array to string and change case of strings
How to use
ES6 import:
use:
import { changeCase, arrayToString } from 'jsmp-infra-filippov'
to get:
changeCase(), arrayToString()
or use
import module6 from 'jsmp-infra-filippov'
to get:
module6.changeCase(), module6.arrayToString()
ES5 common js:
use
const module6 = require('jsmp-infra-filippov')
to get:
module6.changeCase(), module6.arrayToString()
Features
Array to string
arrayToString(array[, separator])
Converts array to string with optional separator string. Divide values with single space (' ') if separator is not passed. Return array without changes if separator is not string.
Examples:
arrayToString([1, 2, 3]) // > '1 2 3'
arrayToString([1, 2, 3], '~~') // > '1~~2~~3'
arrayToString([1, 2, 3], ', ') // > '1, 2, 3'
Change case
changeCase(string[, modifier])
Converts case of string with proper modifier. Doesn't change string if modifier is not passed or doesn't meet at least one of the possible.
Examples:
| string | modifier | result | | ------- | :------: | ------: | | es-code | upper | ES-CODE | | ES-CoDe | lower | es-code | | ES CoDe | kebab | es-code | | es-code | camel | esCode | | ES-CoDe | capital | Escode | | ES-CoDe | other | ES-CoDe |