Files
your-gold/utils/validation.ts
2025-06-27 16:02:00 +02:00

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 };