From 6b1268176a5df95e1d201d083a200cd42897be68 Mon Sep 17 00:00:00 2001 From: Alberto Date: Mon, 24 Jun 2024 15:44:14 +0200 Subject: [PATCH] str style --- lib/str.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/str.ts b/lib/str.ts index 210a72f5..13f8b4f5 100644 --- a/lib/str.ts +++ b/lib/str.ts @@ -350,7 +350,7 @@ const Str = { * @returns True if the string is a domain name */ isValidDomainName(str: string): boolean { - return Boolean(String(str).match(Constants.CONST.REG_EXP.DOMAIN)); + return !!String(str).match(Constants.CONST.REG_EXP.DOMAIN); }, /** @@ -359,7 +359,7 @@ const Str = { * @returns True if the string is a valid hyperlink */ isValidURL(str: string): boolean { - return Boolean(String(str).match(Constants.CONST.REG_EXP.HYPERLINK)); + return !!String(str).match(Constants.CONST.REG_EXP.HYPERLINK); }, /** @@ -371,7 +371,7 @@ const Str = { * @returns True if the string is an email */ isValidEmail(str: string): boolean { - return Boolean(String(str).match(Constants.CONST.REG_EXP.EMAIL)); + !!String(str).match(Constants.CONST.REG_EXP.EMAIL); }, /** @@ -382,7 +382,7 @@ const Str = { * @returns True if the string is an valid email created by comment markdown. */ isValidEmailMarkdown(str: string): boolean { - return Boolean(String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`)); + return !!String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`); }, /** @@ -818,7 +818,7 @@ const Str = { if (this.isString(value)) { return value.toLowerCase() === 'true'; } - return Boolean(value); + return !!value; }, /**