From ae7289c674424e671cbe33ce685618b76db7dd60 Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 16:53:11 -0400 Subject: [PATCH] added _.isObject definition --- lodash/lodash-tests.ts | 4 ++++ lodash/lodash.d.ts | 22 ++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c8c128eb4..76a928aa4 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -634,6 +634,10 @@ result = _.isNull(undefined); result = _.isNumber(8.4 * 5); +result = _.isObject({}); +result = _.isObject([1, 2, 3]); +result = _.isObject(1); + var mergeNames = { 'stooges': [ { 'name': 'moe' }, diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c45939d70..5c1ce82d1 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2459,6 +2459,14 @@ declare module _ { **/ export function isNumber(value: any): boolean; + /** + * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, + * new Number(0), and new String('')) + * @param value The value to check. + * @return True if the value is an object, else false. + **/ + export function isObject(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 @@ -2672,20 +2680,6 @@ declare module _ { **/ export function tap(object: T, intercepter: Function): T; - - - - - - - /** - * Returns true if value is an Object. Note that JavaScript arrays and functions are objects, - * while (normal) strings and numbers are not. - * @param object Check if this object is an Object. - * @return True of `object` is an Object, otherwise false. - **/ - export function isObject(object: any): boolean; - /** * Returns true if object is a String. * @param object Check if this object is a String.