lodash: signatures of the method _.endsWith changed

This commit is contained in:
Ilya Mochalov
2015-10-23 21:47:55 +05:00
parent 3191f6e008
commit 619722abb1
2 changed files with 38 additions and 6 deletions
+18 -4
View File
@@ -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');
+20 -2
View File
@@ -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