MCPcopy Create free account
hub / github.com/ampproject/amphtml / isTemplateMatch

Function isTemplateMatch

third_party/inputmask/inputmask.js:2128–2131  ·  view source on GitHub ↗
(ndx, charCodes)

Source from the content-addressed store, hash-verified

2126 function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
2127 var inputmask = this || input.inputmask, inputValue = nptvl.slice(), charCodes = "", initialNdx = -1, result = undefined;
2128 function isTemplateMatch(ndx, charCodes) {
2129 var charCodeNdx = getMaskTemplate(true, 0, false).slice(ndx, seekNext(ndx)).join("").replace(/'/g, "").indexOf(charCodes);
2130 return charCodeNdx !== -1 && !isMask(ndx) && (getTest(ndx).match.nativeDef === charCodes.charAt(0) || getTest(ndx).match.fn === null && getTest(ndx).match.nativeDef === "'" + charCodes.charAt(0) || getTest(ndx).match.nativeDef === " " && (getTest(ndx + 1).match.nativeDef === charCodes.charAt(0) || getTest(ndx + 1).match.fn === null && getTest(ndx + 1).match.nativeDef === "'" + charCodes.charAt(0)));
2131 }
2132 resetMaskSet();
2133 if (!strict && opts.autoUnmask !== true) {
2134 var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(""), matches = inputValue.join("").match(new RegExp("^" + Inputmask.escapeRegex(staticInput), "g"));

Callers 1

checkValFunction · 0.85

Calls 5

getMaskTemplateFunction · 0.85
seekNextFunction · 0.85
isMaskFunction · 0.85
getTestFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected