mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-24 05:34:47 +08:00
added _.isEmpty definition
This commit is contained in:
@@ -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);
|
||||
|
||||
Vendored
+19
-6
@@ -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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user