MCPcopy
hub / github.com/angular-ui/ui-router / parsePatternAttr

Function parsePatternAttr

test/angular/1.7/angular.js:36247–36261  ·  view source on GitHub ↗
(regex, patternExp, elm)

Source from the content-addressed store, hash-verified

36245
36246
36247function parsePatternAttr(regex, patternExp, elm) {
36248 if (!regex) return undefined;
36249
36250 if (isString(regex)) {
36251 regex = new RegExp('^' + regex + '$');
36252 }
36253
36254 if (!regex.test) {
36255 throw minErr('ngPattern')('noregexp',
36256 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,
36257 regex, startingTag(elm));
36258 }
36259
36260 return regex;
36261}
36262
36263function parseLength(val) {
36264 var intVal = toInt(val);

Callers 1

angular.jsFile · 0.85

Calls 3

isStringFunction · 0.70
minErrFunction · 0.70
startingTagFunction · 0.70

Tested by

no test coverage detected