mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #6421 from chrootsu/lodash-pad
lodash: signatures of the method _.pad changed
This commit is contained in:
+21
-6
@@ -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');
|
||||
|
||||
Vendored
+22
-3
@@ -9160,23 +9160,42 @@ declare module _ {
|
||||
kebabCase(): string;
|
||||
}
|
||||
|
||||
//_.pad
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if
|
||||
* they can’t 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
|
||||
|
||||
Reference in New Issue
Block a user