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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user