Skip to content

Commit

Permalink
feat(utils): Add toQueryString into utils
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoli committed Sep 5, 2018
1 parent 60b5c77 commit b8d0981
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 @@ -6,10 +6,13 @@ import upperFirst from 'lodash/upperFirst';
const createCounter = (count = 0) => () => count++;
const createId = createCounter();

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

export {
createId,
mapKeys,
merge,
pick,
upperFirst,
toQueryString,
};

0 comments on commit b8d0981

Please sign in to comment.