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 : [];
    },
};
