New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@jf/cc2sep

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jf/cc2sep

Transform a camelized string into a lowercased one using a custom separator and accepting unicode uppercase chars.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

@jf/cc2sep stable

npm install @jf/cc2sep

Transform a camelized string into a lowercased one using a custom separator and accepting unicode uppercase chars.

You can modify regexp property for customizing the text transformations in your application.

Arguments

  • text: Text to convert.
  • separator: Separator to use between words (- by defatul).
  • trim: true if you want to remove separators beginning or ending text (true by default).

Examples

cc2sep(text)

'onceuponatime'    => 'onceuponatime'
'onceUponATime'    => 'once-upon-a-time'
'OnceUponATime'    => 'once-upon-a-time'
'ONCE UPON A TIME' => 'o-n-c-e u-p-o-n a t-i-m-e'
'once-upon-a-time' => 'once-upon-a-time'
'innerHTML'        => 'inner-h-t-m-l'
'ÁáááÉéééÍíÓóó'    => 'áááá-éééé-íí-óóó'

cc2sep(text, '-', false)

'OnceUponATime'    -> '-once-upon-a-time'
'ONCE UPON A TIME' -> '-o-n-c-e -u-p-o-n -a -t-i-m-e'
'ÁáááÉéééÍíÓóó'    -> '-áááá-éééé-íí-óóó'

Keywords

camel-case

FAQs

Package last updated on 17 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts