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

Function parsePatternAttr

lib/test/angular/1.8.0/angular.js:36312–36326  ·  view source on GitHub ↗
(regex, patternExp, elm)

Source from the content-addressed store, hash-verified

36310
36311
36312function parsePatternAttr(regex, patternExp, elm) {
36313 if (!regex) return undefined;
36314
36315 if (isString(regex)) {
36316 regex = new RegExp('^' + regex + '$');
36317 }
36318
36319 if (!regex.test) {
36320 throw minErr('ngPattern')('noregexp',
36321 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,
36322 regex, startingTag(elm));
36323 }
36324
36325 return regex;
36326}
36327
36328function parseLength(val) {
36329 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