diff --git a/lib/helpers/buildURL.js b/lib/helpers/buildURL.js index bebacb3..54b3841 100644 --- a/lib/helpers/buildURL.js +++ b/lib/helpers/buildURL.js @@ -3,6 +3,14 @@ var utils = require('../utils'); var AxiosURLSearchParams = require('../helpers/AxiosURLSearchParams'); +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ function encode(val) { return encodeURIComponent(val). replace(/%3A/gi, ':'). @@ -19,6 +27,7 @@ function encode(val) { * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended * @param {?object} options + * * @returns {string} The formatted url */ module.exports = function buildURL(url, params, options) {