Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | 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;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.