mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-28 12:43:06 +08:00
lodash: signatures of the method _.endsWith changed
This commit is contained in:
+18
-4
@@ -3545,10 +3545,24 @@ 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);
|
||||
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<boolean>;
|
||||
|
||||
result = _('abc').chain().endsWith('c');
|
||||
result = _('abc').chain().endsWith('c', 1);
|
||||
}
|
||||
}
|
||||
|
||||
// _.escape
|
||||
result = <string>_.escape('fred, barney, & pebbles');
|
||||
|
||||
Vendored
+20
-2
@@ -9011,19 +9011,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<T> {
|
||||
/**
|
||||
* @see _.endsWith
|
||||
*/
|
||||
endsWith(target?: string, position?: number): boolean;
|
||||
endsWith(
|
||||
target?: string,
|
||||
position?: number
|
||||
): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.endsWith
|
||||
*/
|
||||
endsWith(
|
||||
target?: string,
|
||||
position?: number
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
// _.escape
|
||||
|
||||
Reference in New Issue
Block a user