export const getListValueWithKey = (list, key, k = 'k', v = 'v') => { for (let i = 0, iLen = list.length; i < iLen; i++) { const listI = list[i]; if (listI[k] === key) return listI[v]; } return key; }; export const getUrlSearchParams = () => { const params = new URLSearchParams(location.search); const obj = {}; params.forEach((value, key) => { obj[key] = value; }); return obj; };