generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
25 lines (24 loc) • 625 B
JavaScript
import dayjs from 'dayjs';
export const E_SchemaFormatFunc = {
toLocalTimestamp(time) {
return dayjs(time).format('YYYY-MM-DD hh:mm:ss');
},
toRootElement(isBody) {
return isBody ? 'body' : 'div';
},
toGroupName(group) {
if (['static', 'public'].includes(group)) {
return `${group}Pages`;
}
return group;
},
toCreatorName(createdBy) {
return (createdBy || {}).username || '';
},
toFormatString(param) {
return param.toString();
},
toArrayValue(state) {
return Array.isArray(state) ? state : [];
},
};