Skip to content

Commit

Permalink
chore: improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongliang02 committed Nov 21, 2024
1 parent 2d792ff commit 0071a66
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/validators/src/url/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { toSchema } from '@/url/schema'
*/
export class UrlValidator {
/* eslint-disable @typescript-eslint/no-explicit-any */
// parse functions perform type coercion, so input can be any
// parse functions perform type checking, so input can be any
private schema

/**
Expand Down Expand Up @@ -42,7 +42,7 @@ export class UrlValidator {
/**
* Parses a URL string
*
* @param url - The URL to validate
* @param url - The URL to validate, expects string | URL
* @throws {@link UrlValidationError} if the URL is invalid.
* @returns The URL object if the URL is valid
*
Expand All @@ -64,7 +64,7 @@ export class UrlValidator {
/**
* Parses a URL string with a fallback option.
*
* @param url - The URL to validate
* @param url - The URL to validate, expects string | URL
* @param fallbackUrl - The fallback URL to return if the URL is invalid.
* @throws {@link UrlValidationError} if the URL is invalid and fallbackUrl is not provided.
* @returns The URL object if the URL is valid, else the fallbackUrl (if provided).
Expand All @@ -90,7 +90,7 @@ export class UrlValidator {
/**
* Parses a URL string and returns the pathname with a fallback option.
*
* @param url - The URL to validate and extract pathname from
* @param url - The URL to validate and extract pathname from, expects string | URL
* @param fallbackUrl - The fallback URL to use if the URL is invalid.
* @throws {@link UrlValidationError} if the URL is invalid and fallbackUrl is not provided.
* @returns The pathname of the URL or the fallback URL
Expand Down

0 comments on commit 0071a66

Please sign in to comment.