export default function parseParams(url: string) {
    const rawParams = url.split("?")[1]?.split("&");
    if(typeof rawParams === "undefined") return {};
    const params: { [key: string]: any } = {};
    for(const rawParam of rawParams) {
        const k = rawParam.split("=")[0];
        const v = rawParam.split("=")[1];
        if(v === "true" || v === "false") params[k] = v === "true";
        else if(!Number.isNaN(Number(v))) params[k] = Number(v);
        else params[k] = v;
    }

    return params;
}