2025-03-15 22:47:32 +01:00
|
|
|
import type { LocationQueryValue } from 'vue-router';
|
|
|
|
|
|
|
|
export function queryToString(item?: null | LocationQueryValue | LocationQueryValue[]) {
|
|
|
|
if (item === null)
|
|
|
|
return "";
|
|
|
|
if (item instanceof Array)
|
|
|
|
return queryToString(item[0])
|
|
|
|
return item;
|
|
|
|
}
|
2025-06-11 21:05:17 +02:00
|
|
|
|
|
|
|
export function queryToNumber(item?: null | LocationQueryValue | LocationQueryValue[]) {
|
|
|
|
if (item === null || item === undefined)
|
|
|
|
return undefined;
|
|
|
|
if (item instanceof Array)
|
|
|
|
return queryToNumber(item[0])
|
|
|
|
return Number.parseInt(item, 10);
|
|
|
|
}
|