added _.isPlainObject definition

This commit is contained in:
Brian Zengel
2013-10-20 16:56:33 -04:00
parent ae7289c674
commit 101d2721ae
2 changed files with 16 additions and 0 deletions
+9
View File
@@ -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' },
+7
View File
@@ -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