Update JSDOC

pull/81/head
MillenniumEarl 2021-03-11 11:04:36 +01:00
parent 0e1215e5c9
commit a10755b28c
1 changed files with 6 additions and 4 deletions

View File

@ -273,12 +273,15 @@ export function enforceHttpsUrl(url: string): string {
* Check if the url belongs to the domain of the F95 platform. * Check if the url belongs to the domain of the F95 platform.
*/ */
export function isF95URL(url: string): boolean { export function isF95URL(url: string): boolean {
return url.toString().startsWith(urls.BASE); return url.startsWith(urls.BASE);
} }
/** /**
* Checks if the string passed by parameter has a * Checks if the string passed by parameter has a
* properly formatted and valid path to a URL (HTTP/HTTPS). * properly formatted and valid path to a URL (HTTP/HTTPS).
*
* @author Daveo
* @see https://preview.tinyurl.com/y2f2e2pc
*/ */
export function isStringAValidURL(url: string): boolean { export function isStringAValidURL(url: string): boolean {
// Many thanks to Daveo at StackOverflow (https://preview.tinyurl.com/y2f2e2pc) // Many thanks to Daveo at StackOverflow (https://preview.tinyurl.com/y2f2e2pc)
@ -291,9 +294,8 @@ export function isStringAValidURL(url: string): boolean {
* Check if a particular URL is valid and reachable on the web. * Check if a particular URL is valid and reachable on the web.
* @param {string} url URL to check * @param {string} url URL to check
* @param {boolean} [checkRedirect] * @param {boolean} [checkRedirect]
* If true, the function will consider redirects a violation and return false. * If `true`, the function will consider redirects a violation and return `false`.
* Default: false * Default: `false`
* @returns {Promise<Boolean>} true if the URL exists, false otherwise
*/ */
export async function urlExists( export async function urlExists(
url: string, url: string,