From 99ab1939cfb457ca100b7705335f4d17bc29f666 Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 15:58:36 -0400 Subject: [PATCH] added _.isDate definition --- lodash/lodash-tests.ts | 13 +++++++++---- lodash/lodash.d.ts | 28 +++++++++++++++------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 1d5881056e..151afcc064 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -588,8 +588,15 @@ result = _.invert({ 'first': 'moe', 'second': 'larry' }); (function(...args: any[]) { return _.isArguments(arguments); })(1, 2, 3); -(function () { return _.isArray(arguments); })(); -_.isArray([1, 2, 3]); +(function () { return _.isArray(arguments); })(); +result = _.isArray([1, 2, 3]); + +result = _.isBoolean(null); + +result = _.isDate(new Date()); + + + var mergeNames = { 'stooges': [ @@ -684,9 +691,7 @@ _.isFinite(-101); _.isFinite(-Infinity); -_.isBoolean(null); -_.isDate(new Date()); _.isRegExp(/moe/); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 5ec14ad942..4c11a1c77e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2360,6 +2360,20 @@ declare module _ { **/ export function isArray(value: any): boolean; + /** + * Checks if value is a boolean value. + * @param value The value to check. + * @return True if the value is a boolean value, else false. + **/ + export function isBoolean(value: any): boolean; + + /** + * Checks if value is a date. + * @param value The value to check. + * @return True if the value is a date, else false. + **/ + export function isDate(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 @@ -2632,19 +2646,7 @@ declare module _ { **/ export function isFinite(object: any): boolean; - /** - * Returns true if object is either true or false. - * @param object Check if this object is a bool. - * @return True if `object` is a bool, otherwise false. - **/ - export function isBoolean(object: any): boolean; - - /** - * Returns true if object is a Date. - * @param object Check if this object is a Date. - * @return True if `object` is a Date, otherwise false. - **/ - export function isDate(object: any): boolean; + /** * Returns true if object is a RegExp.