Sha256: e3a4be131537f527ace9d68622ab7484e19e71e0e16700ce7a2667d08ef513d4
Contents?: true
Size: 743 Bytes
Versions: 35
Compression:
Stored size: 743 Bytes
Contents
export const isValidUrl = (urlString, acsType = '') => { try { const urlFromString = new URL(urlString); let valid = urlFromString.protocol === 'https:' || urlFromString.protocol === 'http:' || urlFromString.protocol === 'file:'; if (acsType === 'rhui') { valid = urlFromString.pathname.endsWith('/pulp/content'); } return valid; } catch (e) { return false; } }; export const areSubPathsValid = (subpathsString) => { try { if (subpathsString === '') { return true; } return subpathsString.split(',').every((subpath) => { const trimmedPath = subpath.trim(); return (!trimmedPath.startsWith('/') && trimmedPath.endsWith('/')); }); } catch (e) { return false; } };
Version data entries
35 entries across 35 versions & 1 rubygems