mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge pull request #5533 from chrootsu/lodash-endsWith
lodash: changed _.endsWith() method
This commit is contained in:
@@ -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
17
lodash/lodash.d.ts
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user