refactor: delete containsRegexp() (there is escapeRegExp() in the lang facade)

BREAKING CHANGES:

`containsRegexp` is no more exported from `@angular/core/testing`. It should not have been part of the public API in the first place.
This commit is contained in:
Victor Berchet
2016-06-20 14:21:01 -07:00
parent fdf6bc18dd
commit c5c456120c
7 changed files with 23 additions and 42 deletions

View File

@ -1,9 +0,0 @@
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: any /** TODO #9100 */) => `\\${match[0]}`));
}