From 3a1be5666aee8afdd869b4ea4ef696d31074df76 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Fri, 23 Oct 2015 21:55:38 +0500 Subject: [PATCH] lodash: signatures of the method _.escapeRegExp changed --- lodash/lodash-tests.ts | 16 ++++++++++++++-- lodash/lodash.d.ts | 8 ++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c083edd4c..c81398c17 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3555,8 +3555,20 @@ result = _.escape('fred, barney, & pebbles'); result = _('fred, barney, & pebbles').escape(); // _.escapeRegExp -result = _.escapeRegExp('[lodash](https://lodash.com/)'); -result = _('[lodash](https://lodash.com/)').escapeRegExp(); +module TestEscapeRegExp { + { + let result: string; + + result = _.escapeRegExp('[lodash](https://lodash.com/)'); + result = _('[lodash](https://lodash.com/)').escapeRegExp(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('[lodash](https://lodash.com/)').chain().escapeRegExp(); + } +} // _.kebabCase result = _.kebabCase('Foo Bar'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 881124328..dfb8d4769 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -9048,6 +9048,7 @@ declare module _ { /** * Escapes the RegExp special characters "\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "[", "]", * "{" and "}" in string. + * * @param string The string to escape. * @return Returns the escaped string. */ @@ -9061,6 +9062,13 @@ declare module _ { escapeRegExp(): string; } + interface LoDashExplicitWrapper { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): LoDashExplicitWrapper; + } + //_.kebabCase interface LoDashStatic { /**