mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-27 11:40:08 +08:00
lodash: added _.toPlainObject() method
This commit is contained in:
@@ -850,6 +850,24 @@ var helloWrap2 = _.wrap(helloWrap, function (func) {
|
||||
});
|
||||
helloWrap2();
|
||||
|
||||
/********
|
||||
* Lang *
|
||||
********/
|
||||
|
||||
// _.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();
|
||||
|
||||
/**********
|
||||
* Objects *
|
||||
***********/
|
||||
|
||||
Vendored
+20
@@ -196,6 +196,11 @@ declare module _ {
|
||||
* @see _.value
|
||||
**/
|
||||
valueOf(): T;
|
||||
|
||||
/**
|
||||
* @see _.toPlainObject
|
||||
*/
|
||||
toPlainObject(): Object;
|
||||
}
|
||||
|
||||
interface LoDashWrapper<T> extends LoDashWrapperBase<T, LoDashWrapper<T>> { }
|
||||
@@ -5304,6 +5309,21 @@ declare module _ {
|
||||
wrapper: (func: Function, ...args: any[]) => any): Function;
|
||||
}
|
||||
|
||||
/********
|
||||
* Lang *
|
||||
********/
|
||||
|
||||
//_.toPlainObject
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/*************
|
||||
* Objects *
|
||||
*************/
|
||||
|
||||
Reference in New Issue
Block a user