shlink-web-client/shlink-web-component/utils/helpers/query.ts

6 lines
239 B
TypeScript
Raw Normal View History

2020-12-20 21:28:09 +03:00
import qs from 'qs';
export const parseQuery = <T>(search: string) => qs.parse(search, { ignoreQueryPrefix: true }) as unknown as T;
export const stringifyQuery = (query: any): string => qs.stringify(query, { arrayFormat: 'brackets' });