lodash: signatures of the method _.parseInt have been changed

This commit is contained in:
Ilya Mochalov
2015-11-02 04:26:52 +05:00
parent eb59a40d3c
commit f0462ac3ee
2 changed files with 31 additions and 5 deletions
+18 -4
View File
@@ -3879,10 +3879,24 @@ module TestPadRight {
// _.parseInt
result = <number>_.parseInt('08');
result = <number>_.parseInt('08', 10);
result = <number>_('08').parseInt();
result = <number>_('08').parseInt(10);
module TestParseInt {
{
let result: number;
result = _.parseInt('08');
result = _.parseInt('08', 10);
result = _('08').parseInt();
result = _('08').parseInt(10);
}
{
let result: _.LoDashExplicitWrapper<number>;
result = _('08').chain().parseInt();
result = _('08').chain().parseInt(10);
}
}
// _.repeat
module TestRepeat {
+13 -1
View File
@@ -9392,12 +9392,17 @@ declare module _ {
/**
* Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used
* unless value is a hexadecimal, in which case a radix of 16 is used.
*
* Note: This method aligns with the ES5 implementation of parseInt.
*
* @param string The string to convert.
* @param radix The radix to interpret value by.
* @return Returns the converted integer.
*/
parseInt(string: string, radix?: number): number;
parseInt(
string: string,
radix?: number
): number;
}
interface LoDashImplicitWrapper<T> {
@@ -9407,6 +9412,13 @@ declare module _ {
parseInt(radix?: number): number;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.parseInt
*/
parseInt(radix?: number): LoDashExplicitWrapper<number>;
}
//_.repeat
interface LoDashStatic {
/**