diff --git a/src/lib/services/Utilities.js b/src/lib/services/Utilities.js index 8230e686..832f8507 100644 --- a/src/lib/services/Utilities.js +++ b/src/lib/services/Utilities.js @@ -359,7 +359,14 @@ class Utilities { * @param {string} string The string to transform. */ camelCase(string){ - return string.toLowerCase().trim().split(/[.\-_\s]/g).reduce((string, word) => string + word[0].toUpperCase() + word.slice(1)); + return string + .toLowerCase() + .trim() + .split(/[.\-_\s]/g) + .reduce( + (string, word) => + word.length ? string + word[0].toUpperCase() + word.slice(1) : string + ); }; /** @@ -373,4 +380,4 @@ class Utilities { } } -export default Utilities; \ No newline at end of file +export default Utilities;