mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Bump to v4.3.3.
This commit is contained in:
@@ -1,37 +1,36 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
var root = require('lodash._root');
|
||||
|
||||
/** Used to determine if values are of the language type `Object`. */
|
||||
var objectTypes = {
|
||||
'function': true,
|
||||
'object': true
|
||||
};
|
||||
/** Detect free variable `global` from Node.js. */
|
||||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
||||
|
||||
/** Detect free variable `self`. */
|
||||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||||
|
||||
/** Used as a reference to the global object. */
|
||||
var root = freeGlobal || freeSelf || Function('return this')();
|
||||
|
||||
/** Detect free variable `exports`. */
|
||||
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
|
||||
? exports
|
||||
: undefined;
|
||||
var freeExports = freeGlobal && typeof exports == 'object' && exports;
|
||||
|
||||
/** Detect free variable `module`. */
|
||||
var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
|
||||
? module
|
||||
: undefined;
|
||||
var freeModule = freeExports && typeof module == 'object' && module;
|
||||
|
||||
/** Detect the popular CommonJS extension `module.exports`. */
|
||||
var moduleExports = (freeModule && freeModule.exports === freeExports)
|
||||
? freeExports
|
||||
: undefined;
|
||||
var moduleExports = freeModule && freeModule.exports === freeExports;
|
||||
|
||||
/** Built-in value references. */
|
||||
var Buffer = moduleExports ? root.Buffer : undefined;
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
||||
|
||||
/**
|
||||
* Checks if `value` is a buffer.
|
||||
*
|
||||
@@ -49,31 +48,23 @@ var Buffer = moduleExports ? root.Buffer : undefined;
|
||||
* _.isBuffer(new Uint8Array(2));
|
||||
* // => false
|
||||
*/
|
||||
var isBuffer = !Buffer ? constant(false) : function(value) {
|
||||
return value instanceof Buffer;
|
||||
};
|
||||
var isBuffer = nativeIsBuffer || stubFalse;
|
||||
|
||||
/**
|
||||
* Creates a function that returns `value`.
|
||||
* This method returns `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 2.4.0
|
||||
* @since 4.13.0
|
||||
* @category Util
|
||||
* @param {*} value The value to return from the new function.
|
||||
* @returns {Function} Returns the new constant function.
|
||||
* @returns {boolean} Returns `false`.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'user': 'fred' };
|
||||
* var getter = _.constant(object);
|
||||
*
|
||||
* getter() === object;
|
||||
* // => true
|
||||
* _.times(2, _.stubFalse);
|
||||
* // => [false, false]
|
||||
*/
|
||||
function constant(value) {
|
||||
return function() {
|
||||
return value;
|
||||
};
|
||||
function stubFalse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = isBuffer;
|
||||
|
||||
Reference in New Issue
Block a user