Refactor #4103 - Update lifecycle names in Base* files

This commit is contained in:
mertsincan 2023-07-10 10:34:48 +01:00
parent 2572561902
commit 63b5b8be8e
6 changed files with 71 additions and 33 deletions

View file

@ -201,11 +201,15 @@ export default {
return null;
},
convertToFlatCase(str) {
toFlatCase(str) {
// convert snake, kebab, camel and pascal cases to flat case
return this.isNotEmpty(str) ? str.replace(/(-|_)/g, '').toLowerCase() : str;
},
toCapitalCase(str) {
return this.isNotEmpty(str) ? str[0].toUpperCase() + str.slice(1) : str;
},
isEmpty(value) {
return value === null || value === undefined || value === '' || (Array.isArray(value) && value.length === 0) || (!(value instanceof Date) && typeof value === 'object' && Object.keys(value).length === 0);
},