fix and update

This commit is contained in:
lendry
2026-07-02 00:10:22 +03:00
parent bcdfbc3861
commit 4306d0ce37
11 changed files with 375 additions and 41 deletions

View File

@@ -0,0 +1,10 @@
export const PIN_MIN_LENGTH = 4;
export const PIN_MAX_LENGTH = 6;
export function sanitizePinInput(value: string, maxLength: number = PIN_MAX_LENGTH): string {
return value.replace(/\D/g, '').slice(0, maxLength);
}
export function isPinInputComplete(value: string, minLength: number = PIN_MIN_LENGTH): boolean {
return /^\d+$/.test(value) && value.length >= minLength && value.length <= PIN_MAX_LENGTH;
}