From d90348ebccbad06d731f35e3fd7c52779f88f174 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 9 Sep 2015 05:32:01 +0500 Subject: [PATCH] lodash: added _.prototype.commit() method --- lodash/lodash-tests.ts | 14 ++++++++++++++ lodash/lodash.d.ts | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 5b9add244c..c5344f7d28 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -439,6 +439,20 @@ result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, result = _([1, 2, 3]).thru((value: number[]) => value, any); } +// _.prototype.commit +{ + let result: _.LoDashWrapper; + result = _(42).commit(); +} +{ + let result: _.LoDashArrayWrapper; + result = _([]).commit(); +} +{ + let result: _.LoDashObjectWrapper; + result = _({}).commit(); +} + /************** * Collection * **************/ diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index b6c95710bd..4bc73aae0f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2056,6 +2056,16 @@ declare module _ { thisArg?: any): LoDashArrayWrapper; } + // _.prototype.commit + interface LoDashWrapperBase { + /** + * Executes the chained sequence and returns the wrapped result. + * + * @return Returns the new lodash wrapper instance. + */ + commit(): TWrapper; + } + /************** * Collection * **************/