mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Exit early from _.isEmpty for nullish values.
This commit is contained in:
@@ -11424,6 +11424,9 @@
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isEmpty(value) {
|
function isEmpty(value) {
|
||||||
|
if (value == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (isArrayLike(value) &&
|
if (isArrayLike(value) &&
|
||||||
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
||||||
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user