https://www.website.ru/catalog/kurtki/?size=41332;43296;44278&brand=13974&consists=14;2
const obj = {
size: [41332, 43296, 44278],
brand: [13974],
consists: [14, 2]
}
const obj = (str
.match(/\w+=[\d;]+/g) || [])
.reduce((acc, n) => {
const [ key, values ] = n.split('=');
acc[key] = values.split(';').map(Number);
return acc;
}, {});
const obj = Array
.from(new URL(str).searchParams)
.reduce((acc, [ k, v ]) => (
acc[k] = v.split(';').map(n => +n),
acc
), {});
const baseURL = "https://www.website.ru/catalog/kurtki/?";
const data = {
size: [41332, 43296, 44278],
brand: [13974],
consists: [14, 2]
};
const resultURL = baseURL + "?" + encodeURIComponent(JSON.stringify(data));
const params = resultURL.split("?")[1];
const data = JSON.parse(decodeURIComponent(params));