mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.isPlainObject definition
This commit is contained in:
@@ -638,6 +638,15 @@ result = <boolean>_.isObject({});
|
||||
result = <boolean>_.isObject([1, 2, 3]);
|
||||
result = <boolean>_.isObject(1);
|
||||
|
||||
function Stooge(name, age) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
result = <boolean>_.isPlainObject(new Stooge('moe', 40));
|
||||
result = <boolean>_.isPlainObject([1, 2, 3]);
|
||||
result = <boolean>_.isPlainObject({ 'name': 'moe', 'age': 40 });
|
||||
|
||||
var mergeNames = {
|
||||
'stooges': [
|
||||
{ 'name': 'moe' },
|
||||
|
||||
Vendored
+7
@@ -2467,6 +2467,13 @@ declare module _ {
|
||||
**/
|
||||
export function isObject(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Checks if value is an object created by the Object constructor.
|
||||
* @param value The value to check.
|
||||
* @return True if value is a plain object, else false.
|
||||
**/
|
||||
export function isPlainObject(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Recursively merges own enumerable properties of the source object(s), that don't resolve
|
||||
* to undefined into the destination object. Subsequent sources will overwrite property
|
||||
|
||||
Reference in New Issue
Block a user