Skip to content
Snippets Groups Projects
Commit 57797b8a authored by Mihail Gorceag's avatar Mihail Gorceag
Browse files

fix: fix crash if not string is passed to fn

parent 106b19d6
No related branches found
No related tags found
No related merge requests found
export function convertCamelCaseToText (text) { export function convertCamelCaseToText(text) {
const result = text.replace( /([A-Z])/g, " $1" ) if (typeof text !== 'string') return ''
const finalResult = result.charAt(0) + result.slice(1) const result = text.replace(/([A-Z])/g, ' $1')
return finalResult.toLowerCase() const finalResult = result.charAt(0) + result.slice(1)
} return finalResult.toLowerCase()
\ No newline at end of file }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment