Skip to content

Commit 603f911

Browse files
Fix the isEmpty logic
1 parent 27b4260 commit 603f911

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Rokt-Kit.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,13 @@ function hashEventMessage(messageType, eventType, eventName) {
500500
}
501501

502502
function isEmpty(value) {
503-
return value == null || !(Object.keys(value) || value).length;
503+
return (
504+
value === null ||
505+
value === undefined ||
506+
(typeof value === 'object' && Object.keys(value).length === 0) ||
507+
(typeof value === 'string' && value.length === 0) ||
508+
(Array.isArray(value) && value.length === 0)
509+
);
504510
}
505511

506512
if (window && window.mParticle && window.mParticle.addForwarder) {

0 commit comments

Comments
 (0)