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

This commit is contained in:
Ilya Mochalov
2015-11-02 04:44:07 +05:00
parent eb59a40d3c
commit ee445f7f33
2 changed files with 41 additions and 9 deletions
+21 -6
View File
@@ -3847,12 +3847,27 @@ module TestPad {
}
// _.padLeft
result = <string>_.padLeft('abc');
result = <string>_.padLeft('abc', 6);
result = <string>_.padLeft('abc', 6, '_-');
result = <string>_('abc').padLeft();
result = <string>_('abc').padLeft(6);
result = <string>_('abc').padLeft(6, '_-');
module TestPadLeft {
{
let result: string;
result = _.padLeft('abc');
result = _.padLeft('abc', 6);
result = _.padLeft('abc', 6, '_-');
result = _('abc').padLeft();
result = _('abc').padLeft(6);
result = _('abc').padLeft(6, '_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('abc').chain().padLeft();
result = _('abc').chain().padLeft(6);
result = _('abc').chain().padLeft(6, '_-');
}
}
// _.padRight
module TestPadRight {
+20 -3
View File
@@ -9333,20 +9333,37 @@ declare module _ {
/**
* Pads string on the left side if its shorter than length. Padding characters are truncated if they exceed
* length.
*
* @param string The string to pad.
* @param length The padding length.
* @param chars The string used as padding.
* @return Returns the padded string.
*/
padLeft(string?: string, length?: number, chars?: string): string;
padLeft(
string?: string,
length?: number,
chars?: string
): string;
}
//_.padLeft
interface LoDashImplicitWrapper<T> {
/**
* @see _.padLeft
*/
padLeft(length?: number, chars?: string): string;
padLeft(
length?: number,
chars?: string
): string;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.padLeft
*/
padLeft(
length?: number,
chars?: string
): LoDashExplicitWrapper<string>;
}
//_.padRight