login
This commit is contained in:
12
utils/validation.ts
Normal file
12
utils/validation.ts
Normal file
@ -0,0 +1,12 @@
|
||||
const validation = function (item:string, min:number, max:number, regEx = /.*/) {
|
||||
if (
|
||||
item == undefined ||
|
||||
item.length < min ||
|
||||
item.length > max ||
|
||||
!regEx.test(item)
|
||||
) return false;
|
||||
else return true;
|
||||
};
|
||||
|
||||
|
||||
export { validation };
|
Reference in New Issue
Block a user