Typescript: Add query parameter to url

Date: 2021-10-22
const createParam = (name: string, value: any) =>
    `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
const urlAddParam = (url: string, name: string, value: any) =>
    `${url}${url.indexOf("?") < 0 ? "?" : "&"}${createParam(name, value)}`;
54850cookie-checkTypescript: Add query parameter to url