fix(striker-ui): add getQueryParam()

main
Tsu-ba-me 2 years ago
parent 271b33eaf7
commit 1248a5e14e
  1. 13
      striker-ui/lib/getQueryParam.ts

@ -0,0 +1,13 @@
const getQueryParam = (
queryParam?: string | string[],
{
fallbackValue = '',
joinSeparator = '',
limit = 1,
}: { fallbackValue?: string; joinSeparator?: string; limit?: number } = {},
): string =>
queryParam instanceof Array
? queryParam.slice(0, limit).join(joinSeparator)
: queryParam ?? fallbackValue;
export default getQueryParam;
Loading…
Cancel
Save