12 lines
274 B
TypeScript
12 lines
274 B
TypeScript
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 };
|