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:
+2
-1
@@ -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)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user