* Internal function to clean the given URL.
(url, quiet = false)
| 41 | * Internal function to clean the given URL. |
| 42 | */ |
| 43 | function _cleaning(url, quiet = false) { |
| 44 | let cleanURL = url; |
| 45 | const URLbeforeReplaceCount = countFields(url); |
| 46 | |
| 47 | if (!quiet) { |
| 48 | //Add Fields form Request to global url counter |
| 49 | increaseTotalCounter(URLbeforeReplaceCount); |
| 50 | } |
| 51 | |
| 52 | for (let i = 0; i < providers.length; i++) { |
| 53 | let result = { |
| 54 | "changes": false, |
| 55 | "url": "", |
| 56 | "redirect": false, |
| 57 | "cancel": false |
| 58 | }; |
| 59 | |
| 60 | if (providers[i].matchURL(cleanURL)) { |
| 61 | result = removeFieldsFormURL(providers[i], cleanURL, quiet); |
| 62 | cleanURL = result.url; |
| 63 | } |
| 64 | |
| 65 | if (result.redirect) { |
| 66 | return result.url; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | return cleanURL; |
| 71 | } |
no test coverage detected