Files
js/utils/router.ts
T
Jonas Daniels 6e09d7f85b much longer cache for releases (#326)
* much longer cache for releases

* lots of cache changes etc

* fix vercel url issue

* fix small further things

* only revalidate on actions that actually cause caches to get stale
2022-08-02 21:34:44 -07:00

11 lines
235 B
TypeScript

import type { ParsedUrlQuery } from "querystring";
export function getSingleQueryValue(
query: ParsedUrlQuery = {},
key: string,
): string | undefined {
const _val = query[key];
return Array.isArray(_val) ? _val[0] : _val;
}