2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-05 16:42:28 +03:00

Cleanup of mask.js code

This commit is contained in:
Alexander Shabunevich
2019-12-04 13:35:00 +03:00
parent 2f71d54a5a
commit 9e9be04de7
2 changed files with 6 additions and 3 deletions
+2 -3
View File
@@ -16,9 +16,8 @@ export default function mask (value, mask, tokens, masked = true) {
}
iv++
} else if (token && token.repeat) {
const maskCharPrev = mask[im - 1]
const tokenPrev = tokens[maskCharPrev]
if (token && token.repeat && tokenPrev && !tokenPrev.pattern.test(valueChar)) {
const tokenPrev = tokens[mask[im - 1]]
if (tokenPrev && !tokenPrev.pattern.test(valueChar)) {
im++
} else {
im--