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:
+8
-3
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user