I would imagine this is a multiple part situation with regex, but how would you split a camelcase string at the capital letters turning them in to lowercase letters, and the
Late to answer, but this solution will work for cases where a single letter is camel cased.
'thisIsATest'.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase(); // this-is-a-test