[MM-21835] Use URL instead of the url library (#1384)
Additionally, migrate all of the URL related helper functions from `src/utils/utils.js` to the new `src/utils/url.js` file and migrate tests. Issue MM-21835 Fixes #1206
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// See LICENSE.txt for license information.
|
||||
import Joi from '@hapi/joi';
|
||||
|
||||
import Utils from '../utils/util';
|
||||
import urlUtils from '../utils/url';
|
||||
|
||||
const defaultOptions = {
|
||||
stripUnknown: true,
|
||||
@@ -138,7 +138,7 @@ export function validateV1ConfigData(data) {
|
||||
});
|
||||
|
||||
// next filter out urls that are still invalid so all is not lost
|
||||
teams = teams.filter(({url}) => Utils.isValidURL(url));
|
||||
teams = teams.filter(({url}) => urlUtils.isValidURL(url));
|
||||
|
||||
// replace original teams
|
||||
data.teams = teams;
|
||||
@@ -158,7 +158,7 @@ export function validateV2ConfigData(data) {
|
||||
});
|
||||
|
||||
// next filter out urls that are still invalid so all is not lost
|
||||
teams = teams.filter(({url}) => Utils.isValidURL(url));
|
||||
teams = teams.filter(({url}) => urlUtils.isValidURL(url));
|
||||
|
||||
// replace original teams
|
||||
data.teams = teams;
|
||||
|
Reference in New Issue
Block a user