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

Function isFirstMatch

third_party/inputmask/inputmask.js:852–861  ·  view source on GitHub ↗
(latestMatch, tokenGroup)

Source from the content-addressed store, hash-verified

850 function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {
851 function handleMatch(match, loopNdx, quantifierRecurse) {
852 function isFirstMatch(latestMatch, tokenGroup) {
853 var firstMatch = $.inArray(latestMatch, tokenGroup.matches) === 0;
854 if (!firstMatch) {
855 $.each(tokenGroup.matches, function(ndx, match) {
856 if (match.isQuantifier === true) firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]); else if (match.hasOwnProperty("matches")) firstMatch = isFirstMatch(latestMatch, match);
857 if (firstMatch) return false;
858 });
859 }
860 return firstMatch;
861 }
862 function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {
863 var bestMatch, indexPos;
864 if (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) {

Callers 1

handleMatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected