1234567891011121314151617181920212223242526272829303132 |
- 'use strict'
- module.exports = (text, separator) => {
- separator = typeof separator === 'undefined' ? '_' : separator
- return text
- .replace(/([a-z\d])([A-Z])/g, `$1${separator}$2`)
- .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, `$1${separator}$2`)
- .toLowerCase()
- }
|