mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
Merge pull request #5761 from chrootsu/lodash-plant
lodash: added _.prototype.plant() method
This commit is contained in:
@@ -546,6 +546,32 @@ result = <number[]>_([1, 2]).zipWith<number>([1, 2], [1, 2], [1, 2], [1, 2], [1,
|
||||
result = _({}).commit();
|
||||
}
|
||||
|
||||
// _.prototype.plant
|
||||
{
|
||||
let result: _.LoDashWrapper<number>;
|
||||
result = _(any).plant(42);
|
||||
}
|
||||
{
|
||||
let result: _.LoDashStringWrapper;
|
||||
result = _(any).plant('');
|
||||
}
|
||||
{
|
||||
let result: _.LoDashWrapper<boolean>;
|
||||
result = _(any).plant(true);
|
||||
}
|
||||
{
|
||||
let result: _.LoDashNumberArrayWrapper;
|
||||
result = _(any).plant([42]);
|
||||
}
|
||||
{
|
||||
let result: _.LoDashArrayWrapper<any>;
|
||||
result = _(any).plant<any>([]);
|
||||
}
|
||||
{
|
||||
let result: _.LoDashObjectWrapper<{}>;
|
||||
result = _(any).plant<{}>({});
|
||||
}
|
||||
|
||||
/**************
|
||||
* Collection *
|
||||
**************/
|
||||
|
||||
Vendored
+40
@@ -2042,6 +2042,46 @@ declare module _ {
|
||||
commit(): TWrapper;
|
||||
}
|
||||
|
||||
//_.prototype.plant
|
||||
interface LoDashWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* Creates a clone of the chained sequence planting value as the wrapped value.
|
||||
* @param value The value to plant as the wrapped value.
|
||||
* @return Returns the new lodash wrapper instance.
|
||||
*/
|
||||
plant(value: number): LoDashWrapper<number>;
|
||||
|
||||
/**
|
||||
* @see _.plant
|
||||
*/
|
||||
plant(value: string): LoDashStringWrapper;
|
||||
|
||||
/**
|
||||
* @see _.plant
|
||||
*/
|
||||
plant(value: boolean): LoDashWrapper<boolean>;
|
||||
|
||||
/**
|
||||
* @see _.plant
|
||||
*/
|
||||
plant(value: number[]): LoDashNumberArrayWrapper;
|
||||
|
||||
/**
|
||||
* @see _.plant
|
||||
*/
|
||||
plant<T>(value: T[]): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.plant
|
||||
*/
|
||||
plant<T extends {}>(value: T): LoDashObjectWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.plant
|
||||
*/
|
||||
plant(value: any): LoDashWrapper<any>;
|
||||
}
|
||||
|
||||
/**************
|
||||
* Collection *
|
||||
**************/
|
||||
|
||||
Reference in New Issue
Block a user