2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-08 17:22:27 +03:00

#51 Added value preprocessor

This commit is contained in:
Yury Mamedov
2021-11-10 00:40:25 +03:00
parent 9676906225
commit d3f1a7b582
9 changed files with 23 additions and 9 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ function getOpts (mask) {
if (mask.mask) {
opts.mask = Array.isArray(mask.mask) ? JSON.stringify(mask.mask) : mask.mask
opts.tokens = mask.tokens ? { ...mask.tokens } : {}
opts.preprocessor = mask.preprocessor;
} else {
opts.mask = Array.isArray(mask) ? JSON.stringify(mask) : mask
}
@@ -31,7 +32,7 @@ const directive = () => {
if (state.has(el) && !needUpdate(mask)) {
return
}
state.set(el, new Maska(el, getOpts(mask.value)))
}
}