@tadashi/mask
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -27,12 +27,13 @@ let _cc = 0; | ||
const char = mask.charAt(i); | ||
if (map.has(char) === false) { | ||
res.push(char); | ||
continue | ||
if (value.length > cc) { | ||
if (map.has(char)) { | ||
if (map.get(char).test(value.charAt(cc))) { | ||
res.push(value.charAt(cc++)); | ||
} else { | ||
break | ||
} | ||
} else { | ||
res.push(char); | ||
} | ||
} | ||
if (value.length > cc && map.get(char).test(value.charAt(cc))) { | ||
res.push(value.charAt(cc++)); | ||
} else { | ||
break | ||
} | ||
} | ||
@@ -39,0 +40,0 @@ |
@@ -32,12 +32,13 @@ (function (global, factory) { | ||
const char = mask.charAt(i); | ||
if (map.has(char) === false) { | ||
res.push(char); | ||
continue | ||
if (value.length > cc) { | ||
if (map.has(char)) { | ||
if (map.get(char).test(value.charAt(cc))) { | ||
res.push(value.charAt(cc++)); | ||
} else { | ||
break | ||
} | ||
} else { | ||
res.push(char); | ||
} | ||
} | ||
if (value.length > cc && map.get(char).test(value.charAt(cc))) { | ||
res.push(value.charAt(cc++)); | ||
} else { | ||
break | ||
} | ||
} | ||
@@ -44,0 +45,0 @@ |
{ | ||
"name": "@tadashi/mask", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "The simple and tiny script for input mask", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -29,12 +29,13 @@ 'use strict' | ||
const char = mask.charAt(i) | ||
if (map.has(char) === false) { | ||
res.push(char) | ||
continue | ||
if (value.length > cc) { | ||
if (map.has(char)) { | ||
if (map.get(char).test(value.charAt(cc))) { | ||
res.push(value.charAt(cc++)) | ||
} else { | ||
break | ||
} | ||
} else { | ||
res.push(char) | ||
} | ||
} | ||
if (value.length > cc && map.get(char).test(value.charAt(cc))) { | ||
res.push(value.charAt(cc++)) | ||
} else { | ||
break | ||
} | ||
} | ||
@@ -41,0 +42,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
25066
288