mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Add _.isArrayBuffer and _.isBuffer.
This commit is contained in:
23
lodash.js
23
lodash.js
@@ -9444,6 +9444,27 @@
|
||||
*/
|
||||
var isArray = Array.isArray;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is array-like. A value is considered array-like if it's
|
||||
* not a function and has a `value.length` that's an integer greater than or
|
||||
@@ -14250,9 +14271,11 @@
|
||||
lodash.invoke = invoke;
|
||||
lodash.isArguments = isArguments;
|
||||
lodash.isArray = isArray;
|
||||
lodash.isArrayBuffer = isArrayBuffer;
|
||||
lodash.isArrayLike = isArrayLike;
|
||||
lodash.isArrayLikeObject = isArrayLikeObject;
|
||||
lodash.isBoolean = isBoolean;
|
||||
lodash.isBuffer = isBuffer;
|
||||
lodash.isDate = isDate;
|
||||
lodash.isElement = isElement;
|
||||
lodash.isEmpty = isEmpty;
|
||||
|
||||
@@ -23623,7 +23623,7 @@
|
||||
var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey);
|
||||
|
||||
QUnit.test('should accept falsey arguments', function(assert) {
|
||||
assert.expect(289);
|
||||
assert.expect(291);
|
||||
|
||||
var emptyArrays = lodashStable.map(falsey, alwaysEmptyArray);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user