lodash: changed _.endsWith() method

This commit is contained in:
Ilya Mochalov
2015-08-25 02:46:44 +05:00
parent af81415504
commit f7c02e331d
2 changed files with 20 additions and 1 deletions

View File

@@ -1732,7 +1732,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

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