repackaging: all the repackaging changes squashed
This commit is contained in:
10
modules/@angular/core/testing/regexp.ts
Normal file
10
modules/@angular/core/testing/regexp.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import {RegExpWrapper, StringWrapper} from '../src/facade/lang';
|
||||
|
||||
var _RE_SPECIAL_CHARS =
|
||||
['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
|
||||
var _ESCAPE_RE = RegExpWrapper.create(`[\\${_RE_SPECIAL_CHARS.join('\\')}]`);
|
||||
export function containsRegexp(input: string): RegExp {
|
||||
return RegExpWrapper.create(
|
||||
StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`));
|
||||
}
|
||||
|
Reference in New Issue
Block a user