node-red-contrib-buffer-parser
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -58,4 +58,3 @@ | ||
throw new Error("Spec item is invalid"); | ||
let formattedSpecItem = { | ||
let formattedSpecItem = Object.assign({},item, { | ||
"name": item.name || "item" + itemNumber, | ||
@@ -67,3 +66,3 @@ "type": item.type, | ||
"id" : itemNumber - 1 | ||
}; | ||
}); | ||
@@ -210,2 +209,6 @@ //ensure name is something | ||
let isBuffer = Buffer.isBuffer(data); | ||
if(typeof data == "string"){ | ||
data = new Buffer.from(data); | ||
isBuffer = true; | ||
} | ||
if(!isArray && !isBuffer){ | ||
@@ -580,3 +583,3 @@ throw new Error(`data is not an array or a buffer`); | ||
if(validatedSpec.options.singleResult === false){ | ||
let m = { topic: msg.topic, specification : validatedSpec }; | ||
let m = { topic: msg.topic, specification : item }; | ||
if(validatedSpec.options.setTopic) m.topic = item.name; | ||
@@ -583,0 +586,0 @@ switch (validatedSpec.options.resultType) { |
{ | ||
"name": "node-red-contrib-buffer-parser", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A dynamic node to convert values in a buffer or integer array into the many different data type(s). Supports Big/Little Endian, BCD, byteswapping and much more", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
300118
600