Skip to content

Commit 2498309

Browse files
author
Jonathon Hill
committed
feat: remove qs dependency in favor of URLSearchParams
1 parent 9668972 commit 2498309

File tree

5 files changed

+3094
-8734
lines changed

5 files changed

+3094
-8734
lines changed

dist/index.cjs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
'use strict';
22

3-
const qs = require('qs');
4-
5-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
6-
7-
const qs__default = /*#__PURE__*/_interopDefaultCompat(qs);
8-
93
function oauth(axios, { url, ...credentials }) {
104
return (moreCredentials = {}) => {
115
const body = {
@@ -18,7 +12,7 @@ function oauth(axios, { url, ...credentials }) {
1812
return axios({
1913
url,
2014
method: "post",
21-
data: qs__default.stringify(body)
15+
data: new URLSearchParams(body).toString()
2216
}).then((res) => res.data);
2317
};
2418
}

dist/index.mjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import qs from 'qs';
2-
31
function oauth(axios, { url, ...credentials }) {
42
return (moreCredentials = {}) => {
53
const body = {
@@ -12,7 +10,7 @@ function oauth(axios, { url, ...credentials }) {
1210
return axios({
1311
url,
1412
method: "post",
15-
data: qs.stringify(body)
13+
data: new URLSearchParams(body).toString()
1614
}).then((res) => res.data);
1715
};
1816
}

0 commit comments

Comments
 (0)