Merge pull request #5533 from chrootsu/lodash-endsWith

lodash: changed _.endsWith() method
This commit is contained in:
Masahiro Wakame
2015-08-26 02:08:58 +09:00
2 changed files with 20 additions and 1 deletions

View File

@@ -1761,7 +1761,11 @@ result = <string>_.capitalize('fred');
result = <string>_.deburr('déjà vu');
result = <string>_('déjà vu').deburr();
// _.endsWith
result = <boolean>_.endsWith('abc', 'c');
result = <boolean>_.endsWith('abc', 'c', 1);
result = <boolean>_('abc').endsWith('c');
result = <boolean>_('abc').endsWith('c', 1);
// _.escape
result = <string>_.escape('fred, barney, & pebbles');

17
lodash/lodash.d.ts vendored
View File

@@ -7605,8 +7605,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<T> {
/**
* @see _.endsWith
*/
endsWith(target?: string, position?: number): boolean;
}
// _.escape