isArrayBuffer.js 732 B

12345678910111213141516171819202122232425262728
  1. var baseIsArrayBuffer = require('./_baseIsArrayBuffer'),
  2. baseUnary = require('./_baseUnary'),
  3. nodeUtil = require('./_nodeUtil');
  4. /* Node.js helper references. */
  5. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer;
  6. /**
  7. * Checks if `value` is classified as an `ArrayBuffer` object.
  8. *
  9. * @static
  10. * @memberOf _
  11. * @since 4.3.0
  12. * @category Lang
  13. * @param {*} value The value to check.
  14. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  15. * @example
  16. *
  17. * _.isArrayBuffer(new ArrayBuffer(2));
  18. * // => true
  19. *
  20. * _.isArrayBuffer(new Array(2));
  21. * // => false
  22. */
  23. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  24. module.exports = isArrayBuffer;