1.0.0 • Published 4 years ago

@kamicane/camelize v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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'