import dayjs from "dayjs";
const extraFunctions = {
    false: () => false,
    true: () => true,
    format_date: (format = "YYYY-MM-DD", date = new Date()) => {
        return dayjs(new Date(date)).format(format);
    },
    number: (input = 0) => {
        return Number(input);
    },
    now: (format) => {
        return dayjs().format(format);
    },
    dateDiff: (start = new Date(), end = new Date(), unit = "day") => {
        return dayjs(start).diff(end, unit);
    },
    substring: (text = "", start = 0, end = 1) => {
        return text.substring(start, end);
    },
    startsWith: (text = "", target = "", position = 0) => {
        return text.startsWith(target, position);
    },
    strlen: (input) => {
        return input.length;
    },
    bool: (input) => {
        return Boolean(input);
    },
    upper: (input) => {
        return input.toUpperCase();
    },
    lower: (input) => {
        return input.toLowerCase();
    },
    format_currency: (input, separator = ",") => {
        return `${Number(input)
            .toLocaleString("en-Us")
            .replaceAll(",", `${separator}`)}`;
    },
};
export default extraFunctions;
//# sourceMappingURL=extraFunctions.js.map