lodash: changed _.repeat() method

This commit is contained in:
Ilya Mochalov
2015-08-24 00:07:55 +05:00
parent af81415504
commit 8fc3646872
2 changed files with 19 additions and 3 deletions
+4 -2
View File
@@ -1768,14 +1768,16 @@ result = <string>_('abc').padRight();
result = <string>_('abc').padRight(6);
result = <string>_('abc').padRight(6, '_-');
result = <string>_.repeat('*', 3);
// _.parseInt
result = <number>_.parseInt('08');
result = <number>_.parseInt('08', 10);
result = <number>_('08').parseInt();
result = <number>_('08').parseInt(10);
// _.repeat
result = <string>_.repeat('*', 3);
result = <string>_('*').repeat(3);
// _.snakeCase
result = <string>_.snakeCase('Foo Bar');
result = <string>_('Foo Bar').snakeCase();
+15 -1
View File
@@ -7672,8 +7672,22 @@ declare module _ {
parseInt(radix?: number): number;
}
//_.repeat
interface LoDashStatic {
repeat(str?: string, n?: number): string;
/**
* Repeats the given string n times.
* @param string The string to repeat.
* @param n The number of times to repeat the string.
* @return Returns the repeated string.
*/
repeat(string?: string, n?: number): string;
}
interface LoDashWrapper<T> {
/**
* @see _.repeat
*/
repeat(n?: number): string;
}
//_.snakeCase