mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* advanced filter start * advanced filters stage 2 * adv filters stage 3 * fixes * add test * eslint fixes * age filter update * some fixes and filters tests * fixes 2 * add csv export * fixes 3 * add env variable for adv filter * fix tests * edit env temporary
19 lines
386 B
TypeScript
19 lines
386 B
TypeScript
export default function getValuesArrayFromQuery(val: string | Array<string> | undefined) {
|
|
if (val === undefined) {
|
|
return;
|
|
}
|
|
|
|
const valArray = [];
|
|
if (typeof val === 'string') {
|
|
valArray.push(...val.split(','));
|
|
}
|
|
if (Array.isArray(val)) {
|
|
if (!val.length) {
|
|
return;
|
|
}
|
|
val.forEach(el => valArray.push(...el.split(',')));
|
|
}
|
|
|
|
return valArray;
|
|
}
|