diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 918cc55b4..19de0b252 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3742,10 +3742,24 @@ 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); +module TestEndsWith { + { + let result: boolean; + + result = _.endsWith('abc', 'c'); + result = _.endsWith('abc', 'c', 1); + + result = _('abc').endsWith('c'); + result = _('abc').endsWith('c', 1); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('abc').chain().endsWith('c'); + result = _('abc').chain().endsWith('c', 1); + } +} // _.escape result = _.escape('fred, barney, & pebbles'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 85a735f2f..81e7af976 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -9067,19 +9067,37 @@ declare module _ { interface LoDashStatic { /** * 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; + endsWith( + string?: string, + target?: string, + position?: number + ): boolean; } interface LoDashImplicitWrapper { /** * @see _.endsWith */ - endsWith(target?: string, position?: number): boolean; + endsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; } // _.escape