lodash: added _.prototype.commit() method

This commit is contained in:
Ilya Mochalov
2015-09-16 00:59:05 +05:00
parent 52b0ea5c97
commit d90348ebcc
2 changed files with 24 additions and 0 deletions
+14
View File
@@ -439,6 +439,20 @@ result = <number[]>_([1, 2]).zipWith<number>([1, 2], [1, 2], [1, 2], [1, 2], [1,
result = _([1, 2, 3]).thru<number>((value: number[]) => value, any);
}
// _.prototype.commit
{
let result: _.LoDashWrapper<number>;
result = _(42).commit();
}
{
let result: _.LoDashArrayWrapper<any>;
result = _<any>([]).commit();
}
{
let result: _.LoDashObjectWrapper<any>;
result = _({}).commit();
}
/**************
* Collection *
**************/
+10
View File
@@ -2056,6 +2056,16 @@ declare module _ {
thisArg?: any): LoDashArrayWrapper<TResult>;
}
// _.prototype.commit
interface LoDashWrapperBase<T, TWrapper> {
/**
* Executes the chained sequence and returns the wrapped result.
*
* @return Returns the new lodash wrapper instance.
*/
commit(): TWrapper;
}
/**************
* Collection *
**************/