Skip to content

Commit

Permalink
feat(utils): Add the toQueryString method
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoli committed Dec 14, 2018
1 parent 8de4469 commit 2681afc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import pick from 'lodash/pick';
import uniqueId from 'lodash/uniqueId';
import upperFirst from 'lodash/upperFirst';

const toQueryString = obj => Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');

export {
merge,
pick,
toQueryString,
uniqueId,
upperFirst,
};

0 comments on commit 2681afc

Please sign in to comment.