lodash: signatures of the method _.toPlainObject have been changed

This commit is contained in:
Ilya Mochalov
2015-10-14 03:39:46 +05:00
parent 14ab703f43
commit 28a3484cf9
2 changed files with 26 additions and 18 deletions
+17 -12
View File
@@ -2403,18 +2403,23 @@ result = <boolean>_([]).lte(2);
result = <boolean>_({}).lte(2);
// _.toPlainObject
result = <Object>_.toPlainObject();
result = <Object>_.toPlainObject(true);
result = <Object>_.toPlainObject(1);
result = <Object>_.toPlainObject('a');
result = <Object>_.toPlainObject([]);
result = <Object>_.toPlainObject({});
result = <Object>_(true).toPlainObject();
result = <Object>_(1).toPlainObject();
result = <Object>_('a').toPlainObject();
result = <Object>_([1]).toPlainObject();
result = <Object>_<string>([]).toPlainObject();
result = <Object>_({}).toPlainObject();
module TestToPlainObject {
let result: TResult;
result = _.toPlainObject<TResult>();
result = _.toPlainObject<TResult>(true);
result = _.toPlainObject<TResult>(1);
result = _.toPlainObject<TResult>('a');
result = _.toPlainObject<TResult>([]);
result = _.toPlainObject<TResult>({});
result = _(true).toPlainObject<TResult>().value();
result = _(1).toPlainObject<TResult>().value();
result = _('a').toPlainObject<TResult>().value();
result = _([1]).toPlainObject<TResult>().value();
result = _<string>([]).toPlainObject<TResult>().value();
result = _({}).toPlainObject<TResult>().value();
}
/********
* Math *
+9 -6
View File
@@ -238,11 +238,6 @@ declare module _ {
* @see _.value
**/
valueOf(): T;
/**
* @see _.toPlainObject
*/
toPlainObject(): Object;
}
interface LoDashWrapper<T> extends LoDashWrapperBase<T, LoDashWrapper<T>> { }
@@ -7180,10 +7175,18 @@ declare module _ {
/**
* Converts value to a plain object flattening inherited enumerable properties of value to own properties
* of the plain object.
*
* @param value The value to convert.
* @return Returns the converted plain object.
*/
toPlainObject(value?: any): Object;
toPlainObject<TResult extends {}>(value?: any): TResult;
}
interface LoDashWrapperBase<T, TWrapper> {
/**
* @see _.toPlainObject
*/
toPlainObject<TResult extends {}>(): LoDashObjectWrapper<TResult>;
}
/********