You've already forked AstralRinth
a79b8e0777
* feat: clean up edge case behaviour and add queued to install logic * fix: remove version choice modal * feat: queued flow * feat: standardize headers in app on proj pages * fix: clear btn * feat: installing floating popup * fix: lint * fix: onboarding/reset logic change for modpacks * qa: big ol qa * fix: lint * fix: lint --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
23 lines
826 B
TypeScript
23 lines
826 B
TypeScript
import type { LocationQueryValue, RouteRecordNameGeneric } from 'vue-router'
|
|
|
|
export function queryAsStringOrEmpty(query: LocationQueryValue | LocationQueryValue[]): string {
|
|
return Array.isArray(query) ? (query[0] ?? '') : (query ?? '')
|
|
}
|
|
|
|
export function queryAsString(query: LocationQueryValue | LocationQueryValue[]): string | null {
|
|
return Array.isArray(query) ? (query[0] ?? null) : (query ?? null)
|
|
}
|
|
|
|
export function queryAsStringArray(
|
|
query: LocationQueryValue | LocationQueryValue[] | undefined,
|
|
): string[] {
|
|
if (query === undefined || query === null) {
|
|
return []
|
|
}
|
|
return Array.isArray(query) ? query.map(String) : [String(query)]
|
|
}
|
|
|
|
export function routeNameAsString(name: RouteRecordNameGeneric | undefined): string | undefined {
|
|
return name && typeof name === 'string' ? (name as string) : undefined
|
|
}
|