From 52e96c38dc52c79e0b73679456c7c6e092ffa775 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 8 Oct 2016 10:42:21 -0700 Subject: [PATCH] Exit early from `_.isEmpty` for nullish values. --- lodash.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lodash.js b/lodash.js index 361e74d90..04f967ec2 100644 --- a/lodash.js +++ b/lodash.js @@ -11424,6 +11424,9 @@ * // => false */ function isEmpty(value) { + if (value == null) { + return true; + } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) {