chore: migrate deprecated util.isArray

Deprecated: Use Array.isArray() instead.

Source: https://nodejs.org/docs/latest-v18.x/api/util.html#utilisarrayobject
This commit is contained in:
Rotzbua
2024-05-25 22:55:09 +02:00
parent 3fd2d07c75
commit 9b86874c2d
7 changed files with 13 additions and 13 deletions

View File

@@ -377,7 +377,7 @@ Node.prototype.send = function(msg) {
if (msg === null || typeof msg === "undefined") {
return;
} else if (!util.isArray(msg)) {
} else if (!Array.isArray(msg)) {
// A single message has been passed in
if (typeof msg !== 'object') {
this.error(Log._("nodes.flow.non-message-returned", { type: typeof msg }));
@@ -425,7 +425,7 @@ Node.prototype.send = function(msg) {
if (i < msg.length) {
var msgs = msg[i]; // msgs going to output i
if (msgs !== null && typeof msgs !== "undefined") {
if (!util.isArray(msgs)) {
if (!Array.isArray(msgs)) {
msgs = [msgs];
}
var k = 0;