From f7c02e331d8d04d4d5f37c97ff389f1f021f55f9 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 25 Aug 2015 02:46:44 +0500 Subject: [PATCH] lodash: changed _.endsWith() method --- lodash/lodash-tests.ts | 4 ++++ lodash/lodash.d.ts | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 00ca144fd2..7d24638676 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1732,7 +1732,11 @@ result = _.capitalize('fred'); result = _.deburr('déjà vu'); result = _('déjà vu').deburr(); +// _.endsWith result = _.endsWith('abc', 'c'); +result = _.endsWith('abc', 'c', 1); +result = _('abc').endsWith('c'); +result = _('abc').endsWith('c', 1); // _.escape result = _.escape('fred, barney, & pebbles'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 77daeca2a1..a429a97b94 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -7548,8 +7548,23 @@ declare module _ { deburr(): string; } + //_.endsWith interface LoDashStatic { - endsWith(str?: string, target?: string, position?: number): boolean; + /** + * Checks if string ends with the given target string. + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string ends with target, else false. + */ + endsWith(string?: string, target?: string, position?: number): boolean; + } + + interface LoDashWrapper { + /** + * @see _.endsWith + */ + endsWith(target?: string, position?: number): boolean; } // _.escape