From 47244302fff839f3033dc130c0c11017a0b59999 Mon Sep 17 00:00:00 2001 From: Aisen60 Date: Fri, 18 Sep 2020 13:14:50 +0800 Subject: [PATCH] fix: fix an error when the validLowerCase and validUpperCase function have no params --- src/utils/validate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/validate.js b/src/utils/validate.js index 76bc0b6b..3e91b294 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -33,6 +33,7 @@ export function validURL(url) { * @returns {Boolean} */ export function validLowerCase(str) { + // https://www.coder.work/article/1041931 if (str === undefined || str === null) return false const reg = /^[a-z]+$/ return reg.test(str) @@ -43,6 +44,7 @@ export function validLowerCase(str) { * @returns {Boolean} */ export function validUpperCase(str) { + // https://www.coder.work/article/1041931 if (str === undefined || str === null) return false const reg = /^[A-Z]+$/ return reg.test(str)