lodash.isregexp
Advanced tools
Comparing version 3.0.5 to 4.0.0
73
index.js
/** | ||
* lodash 3.0.5 (Custom Build) <https://lodash.com/> | ||
* lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
@@ -13,2 +13,40 @@ | ||
/** Detect free variable `global` from Node.js. */ | ||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; | ||
/** Detect free variable `exports`. */ | ||
var freeExports = freeGlobal && typeof exports == 'object' && exports; | ||
/** Detect free variable `module`. */ | ||
var freeModule = freeExports && typeof module == 'object' && module; | ||
/** Detect the popular CommonJS extension `module.exports`. */ | ||
var moduleExports = freeModule && freeModule.exports === freeExports; | ||
/** Detect free variable `process` from Node.js. */ | ||
var freeProcess = moduleExports && freeGlobal.process; | ||
/** Used to access faster Node.js helpers. */ | ||
var nodeUtil = (function() { | ||
try { | ||
return freeProcess && freeProcess.binding('util'); | ||
} catch (e) {} | ||
}()); | ||
/* Node.js helper references. */ | ||
var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; | ||
/** | ||
* The base implementation of `_.unary` without support for storing metadata. | ||
* | ||
* @private | ||
* @param {Function} func The function to cap arguments for. | ||
* @returns {Function} Returns the new capped function. | ||
*/ | ||
function baseUnary(func) { | ||
return function(value) { | ||
return func(value); | ||
}; | ||
} | ||
/** Used for built-in method references. */ | ||
@@ -18,3 +56,4 @@ var objectProto = Object.prototype; | ||
/** | ||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* of values. | ||
@@ -25,7 +64,20 @@ */ | ||
/** | ||
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. | ||
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
* The base implementation of `_.isRegExp` without Node.js optimizations. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`. | ||
*/ | ||
function baseIsRegExp(value) { | ||
return isObject(value) && objectToString.call(value) == regexpTag; | ||
} | ||
/** | ||
* Checks if `value` is the | ||
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) | ||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
@@ -58,5 +110,6 @@ * @param {*} value The value to check. | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`. | ||
* @example | ||
@@ -70,6 +123,4 @@ * | ||
*/ | ||
function isRegExp(value) { | ||
return isObject(value) && objectToString.call(value) == regexpTag; | ||
} | ||
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; | ||
module.exports = isRegExp; |
{ | ||
"name": "lodash.isregexp", | ||
"version": "3.0.5", | ||
"version": "4.0.0", | ||
"description": "The lodash method `_.isRegExp` exported as a module.", | ||
@@ -12,3 +12,3 @@ "homepage": "https://lodash.com/", | ||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)", | ||
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)", | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
@@ -15,0 +15,0 @@ ], |
@@ -1,2 +0,2 @@ | ||
# lodash.isregexp v3.0.5 | ||
# lodash.isregexp v4.0.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.isRegExp` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#isRegExp) or [package source](https://github.com/lodash/lodash/blob/3.0.5-npm-packages/lodash.isregexp) for more details. | ||
See the [documentation](https://lodash.com/docs#isRegExp) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.isregexp) for more details. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6504
106
1