Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / isArrayBuffer.js
diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/isArrayBuffer.js b/node_modules/grunt-legacy-util/node_modules/lodash/isArrayBuffer.js
new file mode 100644 (file)
index 0000000..80b8563
--- /dev/null
@@ -0,0 +1,35 @@
+var isObjectLike = require('./isObjectLike');
+
+var arrayBufferTag = '[object ArrayBuffer]';
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as an `ArrayBuffer` object.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArrayBuffer(new ArrayBuffer(2));
+ * // => true
+ *
+ * _.isArrayBuffer(new Array(2));
+ * // => false
+ */
+function isArrayBuffer(value) {
+  return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
+}
+
+module.exports = isArrayBuffer;