added _.isDate definition

This commit is contained in:
Brian Zengel
2013-10-20 15:58:36 -04:00
parent 8895133208
commit 99ab1939cf
2 changed files with 24 additions and 17 deletions

View File

@@ -588,8 +588,15 @@ result = <any>_.invert({ 'first': 'moe', 'second': 'larry' });
(function(...args: any[]) { return <boolean>_.isArguments(arguments); })(1, 2, 3);
(function () { return _.isArray(arguments); })();
_.isArray([1, 2, 3]);
(function () { return <boolean>_.isArray(arguments); })();
result = <boolean>_.isArray([1, 2, 3]);
result = <boolean>_.isBoolean(null);
result = <boolean>_.isDate(new Date());
var mergeNames = {
'stooges': [
@@ -684,9 +691,7 @@ _.isFinite(-101);
_.isFinite(-Infinity);
_.isBoolean(null);
_.isDate(new Date());
_.isRegExp(/moe/);

28
lodash/lodash.d.ts vendored
View File

@@ -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.