From 60b267057f97b9e85bec8b3106c6f4e8f8ee4ce8 Mon Sep 17 00:00:00 2001 From: Menas Erian Date: Mon, 26 Sep 2022 18:01:32 +0400 Subject: [PATCH] Allow deletion of properties with value = undefined --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index dd0144b..3a6f442 100644 --- a/lib/index.js +++ b/lib/index.js @@ -69,7 +69,7 @@ function _delete(obj, prop) { let clone, head = prop[i]; if (obj === null || typeof obj !== 'object' || - !Array.isArray(obj) && obj[head] === undefined) { + !Array.isArray(obj) && !obj.hasOwnProperty(head)) { return obj; }