use hasOwn instead of keys

This commit is contained in:
Patrick Kranz 2025-01-09 15:28:28 +01:00 committed by GitHub
parent d01838ac84
commit 2a78524a90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,7 +127,7 @@ module.exports = function(RED) {
} }
if(msgFormat === 'msg.format') { if(msgFormat === 'msg.format') {
if(!Object.keys(msg).includes("format")) { if(!Object.hasOwn(msg, 'format')) {
node.error("Message format is set to be passed in via msg.format but was not defined", msg); node.error("Message format is set to be passed in via msg.format but was not defined", msg);
return; return;
} }