UNPKG

@mintlify/validation

Version:

Validates mint.json files

29 lines (28 loc) 481 B
const protocols = [ 'http', 'https', 'ftp', 'ftps', 'file', 'data', 'mailto', 'tel', 'sms', 'ws', 'wss', ]; /** * Check if a URL is absolute * @param url - The URL to check * @returns True if the URL is absolute, false otherwise */ export const isAbsoluteUrl = (url) => { if (!url || typeof url !== 'string') return false; try { return URL.canParse(url); } catch (_a) { return false; } };