80b85633f7deb7f3a097f0ad50aa382bae7d3497
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / isArrayBuffer.js
1 var isObjectLike = require('./isObjectLike');
2
3 var arrayBufferTag = '[object ArrayBuffer]';
4
5 /** Used for built-in method references. */
6 var objectProto = Object.prototype;
7
8 /**
9  * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
10  * of values.
11  */
12 var objectToString = objectProto.toString;
13
14 /**
15  * Checks if `value` is classified as an `ArrayBuffer` object.
16  *
17  * @static
18  * @memberOf _
19  * @type Function
20  * @category Lang
21  * @param {*} value The value to check.
22  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
23  * @example
24  *
25  * _.isArrayBuffer(new ArrayBuffer(2));
26  * // => true
27  *
28  * _.isArrayBuffer(new Array(2));
29  * // => false
30  */
31 function isArrayBuffer(value) {
32   return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
33 }
34
35 module.exports = isArrayBuffer;