* Determine if a value is a Buffer * * @param {*} val The value to test * * @returns {boolean} True if value is a Buffer, otherwise false
(val)
| 97 | * @returns {boolean} True if value is a Buffer, otherwise false |
| 98 | */ |
| 99 | function isBuffer(val) { |
| 100 | return ( |
| 101 | val !== null && |
| 102 | !isUndefined(val) && |
| 103 | val.constructor !== null && |
| 104 | !isUndefined(val.constructor) && |
| 105 | isFunction(val.constructor.isBuffer) && |
| 106 | val.constructor.isBuffer(val) |
| 107 | ); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Determine if a value is an ArrayBuffer |
no outgoing calls
no test coverage detected