Projekt

Obecné

Profil

Stáhnout (1.09 KB) Statistiky
| Větev: | Revize:
1 3a515b92 cagy
var root = require('./_root'),
2
    stubFalse = require('./stubFalse');
3
4
/** Detect free variable `exports`. */
5
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
6
7
/** Detect free variable `module`. */
8
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
9
10
/** Detect the popular CommonJS extension `module.exports`. */
11
var moduleExports = freeModule && freeModule.exports === freeExports;
12
13
/** Built-in value references. */
14
var Buffer = moduleExports ? root.Buffer : undefined;
15
16
/* Built-in method references for those with the same name as other `lodash` methods. */
17
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
18
19
/**
20
 * Checks if `value` is a buffer.
21
 *
22
 * @static
23
 * @memberOf _
24
 * @since 4.3.0
25
 * @category Lang
26
 * @param {*} value The value to check.
27
 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
28
 * @example
29
 *
30
 * _.isBuffer(new Buffer(2));
31
 * // => true
32
 *
33
 * _.isBuffer(new Uint8Array(2));
34
 * // => false
35
 */
36
var isBuffer = nativeIsBuffer || stubFalse;
37
38
module.exports = isBuffer;