Update ObjectUtils.js

pull/4186/head
mertsincan 2023-07-12 10:47:23 +01:00
parent a00e1a07a0
commit 487c2375f6
1 changed files with 2 additions and 2 deletions

View File

@ -203,11 +203,11 @@ export default {
toFlatCase(str) {
// convert snake, kebab, camel and pascal cases to flat case
return this.isNotEmpty(str) ? str.replace(/(-|_)/g, '').toLowerCase() : str;
return this.isNotEmpty(str) && this.isString(str) ? str.replace(/(-|_)/g, '').toLowerCase() : str;
},
toCapitalCase(str) {
return this.isNotEmpty(str) ? str[0].toUpperCase() + str.slice(1) : str;
return this.isNotEmpty(str) && this.isString(str) ? str[0].toUpperCase() + str.slice(1) : str;
},
isEmpty(value) {