mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Avoid misinterpreting valid objects as encoded arrays in debug
This commit is contained in:
parent
8423e2d245
commit
bba3ca8cc0
@ -89,7 +89,7 @@ RED.utils = (function() {
|
|||||||
|
|
||||||
var isArray = Array.isArray(obj);
|
var isArray = Array.isArray(obj);
|
||||||
var isArrayObject = false;
|
var isArrayObject = false;
|
||||||
if (obj && typeof obj === 'object' && obj.hasOwnProperty('type') && obj.hasOwnProperty('data')) {
|
if (obj && typeof obj === 'object' && obj.hasOwnProperty('type') && obj.hasOwnProperty('data') && ((obj.__encoded__ && obj.type === 'array') || obj.type === 'Buffer')) {
|
||||||
isArray = true;
|
isArray = true;
|
||||||
isArrayObject = true;
|
isArrayObject = true;
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
if (util.isArray(value) && value.length > debuglength) {
|
if (util.isArray(value) && value.length > debuglength) {
|
||||||
value = {
|
value = {
|
||||||
|
__encoded__: true,
|
||||||
type: "array",
|
type: "array",
|
||||||
data: value.slice(0,debuglength),
|
data: value.slice(0,debuglength),
|
||||||
length: value.length
|
length: value.length
|
||||||
|
Loading…
Reference in New Issue
Block a user