repackaging: all the repackaging changes squashed

This commit is contained in:
Igor Minar
2016-04-28 17:50:03 -07:00
committed by Misko Hevery
parent 505da6c0a8
commit a66cdb469f
860 changed files with 7869 additions and 4985 deletions

View 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]}`));
}