MCPcopy
hub / github.com/BorisMoore/jquery-tmpl / getName

Function getName

demos/movies/components/jquery-ui-1.8.1.custom.js:1179–1188  ·  view source on GitHub ↗
(match, shortNames, longNames)

Source from the content-addressed store, hash-verified

1177 };
1178 // Extract a name from the string value and convert to an index
1179 var getName = function(match, shortNames, longNames) {
1180 var names = (lookAhead(match) ? longNames : shortNames);
1181 for (var i = 0; i < names.length; i++) {
1182 if (value.substr(iValue, names[i].length) == names[i]) {
1183 iValue += names[i].length;
1184 return i + 1;
1185 }
1186 }
1187 throw 'Unknown name at position ' + iValue;
1188 };
1189 // Confirm that a literal character matches the string value
1190 var checkLiteral = function() {
1191 if (value.charAt(iValue) != format.charAt(iFormat))

Callers 1

Calls 1

lookAheadFunction · 0.85

Tested by

no test coverage detected