2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-14 18:42:27 +03:00

#27 Fix escaped token at the end

This commit is contained in:
Alexander Shabunevich
2021-05-28 15:43:54 +03:00
parent d03871d5db
commit d07191a458
10 changed files with 26 additions and 17 deletions
+8 -3
View File
@@ -55,9 +55,14 @@ function process (value, mask, tokens, masked = true) {
ret += tokenTransform(valueChar, token)
im++
// check next char
if (masked && mask[im] && !tokens[mask[im]]) {
ret += mask[im]
im++
if (masked && mask[im]) {
if (!tokens[mask[im]]) {
ret += mask[im]
im++
} else if (tokens[mask[im]] && tokens[mask[im]].escape) {
ret += mask[im+1]
im = im+2
}
}
}
iv++