// Minimal querystring shim for CF Workers
// Only implements stringify() which is what @arcblock/did-connect-js uses

export function stringify(obj: Record<string, any>): string {
  return new URLSearchParams(obj).toString();
}

export function parse(str: string): Record<string, string> {
  return Object.fromEntries(new URLSearchParams(str).entries());
}

export default { stringify, parse };
