Skip to content

Commit

Permalink
fix: Remove legacy URL module to support non-Node.js env
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Nov 15, 2022
1 parent a7eac35 commit 458340e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/serializers/serializer-nodejs-impl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { camelCase, snakeCase } from 'change-case';
import type { ParsedUrlQuery } from 'querystring';
import { stringify } from 'querystring';

import { flattenObject } from './form-data';
import type { MimeType, Serializer } from './serializer';
Expand All @@ -24,7 +22,7 @@ export class SerializerNodejsImpl implements Serializer {
return formData;
}
case 'application/x-www-form-urlencoded':
return stringify(data as ParsedUrlQuery);
return new URLSearchParams(data as Record<string, string>).toString();
default:
return;
}
Expand Down

0 comments on commit 458340e

Please sign in to comment.