stringify.ts 221 B

123456789
  1. export function stringify(obj: Record<string, any>) {
  2. if (!obj) return '';
  3. else if (typeof obj === 'object') {
  4. return Object.keys(obj)
  5. .map((key) => `${key}=${obj[key]}`)
  6. .join('&');
  7. }
  8. return '';
  9. }