lodash: signatures of the method _.pad changed

This commit is contained in:
Ilya Mochalov
2015-10-24 15:39:12 +05:00
parent 3191f6e008
commit 8243b02a3d
2 changed files with 43 additions and 9 deletions
+21 -6
View File
@@ -3563,12 +3563,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
@@ -9078,23 +9078,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