diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index ecb87c0ba..0f59e8114 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1062,6 +1062,14 @@ result = _(1).gte(2); result = _([]).gte(2); result = _({}).gte(2); +// _.isEmpty +result = _.isEmpty([1, 2, 3]); +result = _.isEmpty({}); +result = _.isEmpty(''); +result = _([1, 2, 3]).isEmpty(); +result = _({}).isEmpty(); +result = _('').isEmpty(); + // _.isMatch var testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean; result = _.isMatch({}, {}); @@ -1282,10 +1290,6 @@ result = _.isDate(new Date()); result = _.isElement(document.body); -result = _.isEmpty([1, 2, 3]); -result = _.isEmpty({}); -result = _.isEmpty(''); - // _.isEqual (alias: _.eq) result = _.isEqual(1, 1); result = _(1).isEqual(1); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 8a97d0946..4b0059a1d 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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|string|any): boolean; + } + + interface LoDashWrapperBase { + /** + * @see _.isEmpty + */ + isEmpty(): boolean; + } + //_.isMatch interface isMatchCustomizer { (value: any, other: any, indexOrKey?: number|string): boolean; @@ -6629,17 +6647,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|string|any): boolean; - } - //_.isError interface LoDashStatic { /**