Merge pull request #6421 from chrootsu/lodash-pad

lodash: signatures of the method _.pad changed
This commit is contained in:
Masahiro Wakame
2015-10-27 00:50:26 +09:00
2 changed files with 43 additions and 9 deletions
+21 -6
View File
@@ -3778,12 +3778,27 @@ result = <string>_.kebabCase('Foo Bar');
result = <string>_('Foo Bar').kebabCase();
// _.pad
result = <string>_.pad('abd');
result = <string>_.pad('abc', 8);
result = <string>_.pad('abc', 8, '_-');
result = <string>_('abc').pad();
result = <string>_('abc').pad(8);
result = <string>_('abc').pad(8, '_-');
module TestPad {
{
let result: string;
result = _.pad('abd');
result = _.pad('abc', 8);
result = _.pad('abc', 8, '_-');
result = _('abc').pad();
result = _('abc').pad(8);
result = _('abc').pad(8, '_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('abc').chain().pad();
result = _('abc').chain().pad(8);
result = _('abc').chain().pad(8, '_-');
}
}
// _.padLeft
result = <string>_.padLeft('abc');
+22 -3
View File
@@ -9160,23 +9160,42 @@ declare module _ {
kebabCase(): string;
}
//_.pad
interface LoDashStatic {
/**
* Pads string on the left and right sides if its shorter than length. Padding characters are truncated if
* they cant be evenly divided by length.
*
* @param string The string to pad.
* @param length The padding length.
* @param chars The string used as padding.
* @return Returns the padded string.
*/
pad(string?: string, length?: number, chars?: string): string;
pad(
string?: string,
length?: number,
chars?: string
): string;
}
//_.pad
interface LoDashImplicitWrapper<T> {
/**
* @see _.pad
*/
pad(length?: number, chars?: string): string;
pad(
length?: number,
chars?: string
): string;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.pad
*/
pad(
length?: number,
chars?: string
): LoDashExplicitWrapper<string>;
}
//_.padLeft