added _.isEmpty definition

This commit is contained in:
Brian Zengel
2013-10-20 16:13:27 -04:00
parent 0bcaa7d138
commit 41b56088b2
2 changed files with 24 additions and 8 deletions
+5 -2
View File
@@ -597,6 +597,10 @@ result = <boolean>_.isDate(new Date());
result = <boolean>_.isElement(document.body);
result = <boolean>_.isEmpty([1, 2, 3]);
result = <boolean>_.isEmpty({});
result = <boolean>_.isEmpty('');
var mergeNames = {
'stooges': [
@@ -672,8 +676,7 @@ var clone = { name: 'moe', luckyNumbers: [13, 27, 34] };
moe == clone;
_.isEqual(moe, clone);
_.isEmpty([1, 2, 3]);
_.isEmpty({});
_.isObject({});
_.isObject(1);
+19 -6
View File
@@ -2381,6 +2381,24 @@ declare module _ {
**/
export function isElement(value: any): boolean;
/**
* Checks if value is empty. Arrays, strings, or arguments objects with a length of 0 and objects
* with no own enumerable properties are considered "empty".
* @param value The value to inspect.
* @return True if the value is empty, else false.
**/
export function isEmpty(value: any[]): boolean;
/**
* @see _.isEmpty
**/
export function isEmpty(value: Dictionary<any>): boolean;
/**
* @see _.isEmpty
**/
export function isEmpty(value: string): 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
@@ -2603,12 +2621,7 @@ declare module _ {
**/
export function isEqual(object: any, other: any): boolean;
/**
* Returns true if object contains no values.
* @param object Check if this object has no properties or values.
* @return True if `object` is empty.
**/
export function isEmpty(object: any): boolean;