diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index e0fdc819e..7927a04ed 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -546,6 +546,32 @@ result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, result = _({}).commit(); } +// _.prototype.plant +{ + let result: _.LoDashWrapper; + result = _(any).plant(42); +} +{ + let result: _.LoDashStringWrapper; + result = _(any).plant(''); +} +{ + let result: _.LoDashWrapper; + result = _(any).plant(true); +} +{ + let result: _.LoDashNumberArrayWrapper; + result = _(any).plant([42]); +} +{ + let result: _.LoDashArrayWrapper; + result = _(any).plant([]); +} +{ + let result: _.LoDashObjectWrapper<{}>; + result = _(any).plant<{}>({}); +} + /************** * Collection * **************/ diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 875513570..7e879b16b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2042,6 +2042,46 @@ declare module _ { commit(): TWrapper; } + //_.prototype.plant + interface LoDashWrapperBase { + /** + * 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; + + /** + * @see _.plant + */ + plant(value: string): LoDashStringWrapper; + + /** + * @see _.plant + */ + plant(value: boolean): LoDashWrapper; + + /** + * @see _.plant + */ + plant(value: number[]): LoDashNumberArrayWrapper; + + /** + * @see _.plant + */ + plant(value: T[]): LoDashArrayWrapper; + + /** + * @see _.plant + */ + plant(value: T): LoDashObjectWrapper; + + /** + * @see _.plant + */ + plant(value: any): LoDashWrapper; + } + /************** * Collection * **************/