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

@@ -862,7 +862,7 @@ function encodeObject(msg,opts) {
message: msg.msg.message
});
} else {
var isArray = util.isArray(msg.msg);
var isArray = Array.isArray(msg.msg);
var needsStringify = isArray;
if (isArray) {
msg.format = "array["+msg.msg.length+"]";
@@ -906,7 +906,7 @@ function encodeObject(msg,opts) {
}
} else if (value instanceof Error) {
value = value.toString()
} else if (util.isArray(value) && value.length > debuglength) {
} else if (Array.isArray(value) && value.length > debuglength) {
value = {
__enc__: true,
type: "array",