From c928fee373c4ba6da8d30e63f65db57ba88cb86d Mon Sep 17 00:00:00 2001 From: Krzysztof Rzymkowski Date: Fri, 10 Mar 2017 07:20:03 +0100 Subject: [PATCH] lodash - _.filter(): predicate can be a RegExp (#14961) --- lodash/index.d.ts | 10 +++++----- lodash/lodash-tests.ts | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lodash/index.d.ts b/lodash/index.d.ts index e473545d33..da5710a7de 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -6707,7 +6707,7 @@ declare namespace _ { */ filter( collection: List|Dictionary, - predicate: string + predicate: string|RegExp ): T[]; /** @@ -6740,7 +6740,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashImplicitArrayWrapper; /** @@ -6761,7 +6761,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashImplicitArrayWrapper; /** @@ -6791,7 +6791,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashExplicitArrayWrapper; /** @@ -6812,7 +6812,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashExplicitArrayWrapper; /** diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8ccd742a0e..8accba65c0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3625,14 +3625,17 @@ namespace TestFilter { result = _.filter(array, listIterator); result = _.filter(array, ''); + result = _.filter(array, /./); result = _.filter(array, {a: 42}); result = _.filter(list, listIterator); result = _.filter(list, ''); + result = _.filter(list, /./); result = _.filter(list, {a: 42}); result = _.filter(dictionary, dictionaryIterator); result = _.filter(dictionary, ''); + result = _.filter(dictionary, /./); result = _.filter(dictionary, {a: 42}); } @@ -3647,14 +3650,17 @@ namespace TestFilter { result = _(array).filter(listIterator); result = _(array).filter(''); + result = _(array).filter(/./); result = _(array).filter({a: 42}); result = _(list).filter(listIterator); result = _(list).filter(''); + result = _(list).filter(/./); result = _(list).filter({a: 42}); result = _(dictionary).filter(dictionaryIterator); result = _(dictionary).filter(''); + result = _(dictionary).filter(/./); result = _(dictionary).filter({a: 42}); } @@ -3669,14 +3675,17 @@ namespace TestFilter { result = _(array).chain().filter(listIterator); result = _(array).chain().filter(''); + result = _(array).chain().filter(/./); result = _(array).chain().filter({a: 42}); result = _(list).chain().filter(listIterator); result = _(list).chain().filter(''); + result = _(list).chain().filter(/./); result = _(list).chain().filter({a: 42}); result = _(dictionary).chain().filter(dictionaryIterator); result = _(dictionary).chain().filter(''); + result = _(dictionary).chain().filter(/./); result = _(dictionary).chain().filter({a: 42}); } }