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