We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ce86ca commit e57b657Copy full SHA for e57b657
src/masker.js
@@ -148,16 +148,21 @@ export function formatter(value, config) {
148
149
valueIndex++
150
} else {
151
- accumulator += maskChar
152
if (looselyStringMatch(char, maskChar)) {
153
// user typed the same char as static mask char
+ output.masked += accumulator + maskChar
154
155
- output.masked += accumulator
156
accumulator = ''
+
157
+ if (meta.optional) {
158
+ output.unmasked += maskChar
159
+ }
160
+ } else if (!meta.optional) {
161
+ accumulator += maskChar
162
}
163
164
escaped = false
- maskIndex++
165
+ maskIndex += meta.optional ? 2 : 1
166
167
168
0 commit comments