2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

docs(helpers/buildURL)

This commit is contained in:
Jay
2022-06-02 20:51:03 +02:00
parent 18e563d7f8
commit 6f06e25f53
+9
View File
@@ -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) {