Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / isDate.js
diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/isDate.js b/node_modules/grunt-legacy-util/node_modules/lodash/isDate.js
new file mode 100644 (file)
index 0000000..6e3611a
--- /dev/null
@@ -0,0 +1,35 @@
+var isObjectLike = require('./isObjectLike');
+
+/** `Object#toString` result references. */
+var dateTag = '[object Date]';
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Date` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isDate(new Date);
+ * // => true
+ *
+ * _.isDate('Mon April 23 2012');
+ * // => false
+ */
+function isDate(value) {
+  return isObjectLike(value) && objectToString.call(value) == dateTag;
+}
+
+module.exports = isDate;