mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
docs(helpers/buildURL)
This commit is contained in:
@@ -3,6 +3,14 @@
|
|||||||
var utils = require('../utils');
|
var utils = require('../utils');
|
||||||
var AxiosURLSearchParams = require('../helpers/AxiosURLSearchParams');
|
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) {
|
function encode(val) {
|
||||||
return encodeURIComponent(val).
|
return encodeURIComponent(val).
|
||||||
replace(/%3A/gi, ':').
|
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 {string} url The base of the url (e.g., http://www.google.com)
|
||||||
* @param {object} [params] The params to be appended
|
* @param {object} [params] The params to be appended
|
||||||
* @param {?object} options
|
* @param {?object} options
|
||||||
|
*
|
||||||
* @returns {string} The formatted url
|
* @returns {string} The formatted url
|
||||||
*/
|
*/
|
||||||
module.exports = function buildURL(url, params, options) {
|
module.exports = function buildURL(url, params, options) {
|
||||||
|
|||||||
Reference in New Issue
Block a user