summaryrefslogtreecommitdiff
path: root/school/node_modules/axios/lib/helpers/buildURL.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
committerMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
commit3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch)
tree75be5fba4368472fb11c8015aee026b2b9a71888 /school/node_modules/axios/lib/helpers/buildURL.js
parent8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff)
downloadpluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'school/node_modules/axios/lib/helpers/buildURL.js')
-rw-r--r--school/node_modules/axios/lib/helpers/buildURL.js56
1 files changed, 0 insertions, 56 deletions
diff --git a/school/node_modules/axios/lib/helpers/buildURL.js b/school/node_modules/axios/lib/helpers/buildURL.js
deleted file mode 100644
index 693b85f..0000000
--- a/school/node_modules/axios/lib/helpers/buildURL.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-import utils from '../utils.js';
-import AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';
-
-/**
- * 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, ':').
- replace(/%24/g, '$').
- replace(/%2C/gi, ',').
- replace(/%20/g, '+').
- replace(/%5B/gi, '[').
- replace(/%5D/gi, ']');
-}
-
-/**
- * Build a URL by appending params to the end
- *
- * @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
- */
-export default function buildURL(url, params, options) {
- /*eslint no-param-reassign:0*/
- if (!params) {
- return url;
- }
-
- const hashmarkIndex = url.indexOf('#');
-
- if (hashmarkIndex !== -1) {
- url = url.slice(0, hashmarkIndex);
- }
-
- const _encode = options && options.encode || encode;
-
- const serializerParams = utils.isURLSearchParams(params) ?
- params.toString() :
- new AxiosURLSearchParams(params, options).toString(_encode);
-
- if (serializerParams) {
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
- }
-
- return url;
-}