mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
lodash: changed _.isEmpty() method
This commit is contained in:
@@ -1062,6 +1062,14 @@ result = <boolean>_(1).gte(2);
|
||||
result = <boolean>_([]).gte(2);
|
||||
result = <boolean>_({}).gte(2);
|
||||
|
||||
// _.isEmpty
|
||||
result = <boolean>_.isEmpty([1, 2, 3]);
|
||||
result = <boolean>_.isEmpty({});
|
||||
result = <boolean>_.isEmpty('');
|
||||
result = <boolean>_([1, 2, 3]).isEmpty();
|
||||
result = <boolean>_({}).isEmpty();
|
||||
result = <boolean>_('').isEmpty();
|
||||
|
||||
// _.isMatch
|
||||
var testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean;
|
||||
result = <boolean>_.isMatch({}, {});
|
||||
@@ -1272,10 +1280,6 @@ result = <boolean>_.isDate(new Date());
|
||||
|
||||
result = <boolean>_.isElement(document.body);
|
||||
|
||||
result = <boolean>_.isEmpty([1, 2, 3]);
|
||||
result = <boolean>_.isEmpty({});
|
||||
result = <boolean>_.isEmpty('');
|
||||
|
||||
// _.isEqual (alias: _.eq)
|
||||
result = <boolean>_.isEqual(1, 1);
|
||||
result = <boolean>_(1).isEqual(1);
|
||||
|
||||
Vendored
+18
-11
@@ -5861,6 +5861,24 @@ declare module _ {
|
||||
gte(other: any): boolean;
|
||||
}
|
||||
|
||||
//_.isEmpty
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or
|
||||
* jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
|
||||
* @param value The value to inspect.
|
||||
* @return Returns true if value is empty, else false.
|
||||
**/
|
||||
isEmpty(value?: any[]|Dictionary<any>|string|any): boolean;
|
||||
}
|
||||
|
||||
interface LoDashWrapperBase<T,TWrapper> {
|
||||
/**
|
||||
* @see _.isEmpty
|
||||
*/
|
||||
isEmpty(): boolean;
|
||||
}
|
||||
|
||||
//_.isMatch
|
||||
interface isMatchCustomizer {
|
||||
(value: any, other: any, indexOrKey?: number|string): boolean;
|
||||
@@ -6594,17 +6612,6 @@ declare module _ {
|
||||
isElement(value?: any): boolean;
|
||||
}
|
||||
|
||||
//_.isEmpty
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
isEmpty(value?: any[]|Dictionary<any>|string|any): boolean;
|
||||
}
|
||||
|
||||
//_.isError
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user