lodash.isregexp
Advanced tools
+62
-11
| /** | ||
| * 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; |
+27
-2
@@ -1,5 +0,15 @@ | ||
| Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
| Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, | ||
| Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
| Based on Underscore.js, copyright Jeremy Ashkenas, | ||
| DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> | ||
| This software consists of voluntary contributions made by many | ||
| individuals. For exact contribution history, see the revision history | ||
| available at https://github.com/lodash/lodash | ||
| The following license applies to all parts of this software except as | ||
| documented below: | ||
| ==== | ||
| Permission is hereby granted, free of charge, to any person obtaining | ||
@@ -23,1 +33,16 @@ a copy of this software and associated documentation files (the | ||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| ==== | ||
| Copyright and related rights for sample code are waived via CC0. Sample | ||
| code is defined as all source code displayed within the prose of the | ||
| documentation. | ||
| CC0: http://creativecommons.org/publicdomain/zero/1.0/ | ||
| ==== | ||
| Files located in the node_modules and vendor directories are externally | ||
| maintained libraries used by this software which have their own | ||
| licenses; we recommend you read them, as their terms may differ from the | ||
| terms above. |
+2
-2
| { | ||
| "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 @@ ], |
+2
-2
@@ -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. |
Mixed license
LicensePackage contains multiple licenses.
Found 1 instance in 1 package
6504
52.21%106
65.63%1
Infinity%