@kamicane/camelize

camelize & hyphenate

Usage no npm install needed!

<script type="module">
  import kamicaneCamelize from 'https://cdn.skypack.dev/@kamicane/camelize';
</script>

README

camelize

stupid simple camelize implementation, dates back to the mootools era

const { camelize, hyphenate } = require('@kamicane/camelize')
const camelize = require('@kamicane/camelize/camelize')
const hyphenate = require('@kamicane/camelize/hypenate')
camelize("the-quick-brown-fox")
// 'theQuickBrownFox'
camelize("the-quick-brown--fox.jumps---over..the-lazy_dog")
// 'theQuickBrownFoxJumpsOverTheLazyDog'
camelize("-the-quick")
// 'TheQuick'
> hyphenate('theQuickBrownFox')
// 'the-quick-brown-fox'
> hyphenate('TheQuickBrownFox')
// '-the-quick-brown-fox'
> hyphenate('theQuickBrownFox', '.')
// 'the.quick.brown.fox'