Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / lang / isRegExp.js
1 var isObject = require('./isObject');
2
3 /** `Object#toString` result references. */
4 var regexpTag = '[object RegExp]';
5
6 /** Used for native method references. */
7 var objectProto = Object.prototype;
8
9 /**
10  * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
11  * of values.
12  */
13 var objToString = objectProto.toString;
14
15 /**
16  * Checks if `value` is classified as a `RegExp` object.
17  *
18  * @static
19  * @memberOf _
20  * @category Lang
21  * @param {*} value The value to check.
22  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
23  * @example
24  *
25  * _.isRegExp(/abc/);
26  * // => true
27  *
28  * _.isRegExp('/abc/');
29  * // => false
30  */
31 function isRegExp(value) {
32   return isObject(value) && objToString.call(value) == regexpTag;
33 }
34
35 module.exports = isRegExp;