Files
your-gold/utils/validation.ts
2025-07-03 11:13:42 +02:00

18 lines
265 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 }