Commit 5b3d629d authored by yann300's avatar yann300

double quoted number and hex string

parent 9d4cbb79
...@@ -51,6 +51,8 @@ module.exports = { ...@@ -51,6 +51,8 @@ module.exports = {
data = Buffer.from(dataHex, 'hex') data = Buffer.from(dataHex, 'hex')
} else { } else {
try { try {
params = params.replace(/(^|,\s+|,)(\d+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted number by quoted number
params = params.replace(/(^|,\s+|,)(0[xX][0-9a-fA-F]+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted hex string by quoted hex string
funArgs = JSON.parse('[' + params + ']') funArgs = JSON.parse('[' + params + ']')
} catch (e) { } catch (e) {
callback('Error encoding arguments: ' + e) callback('Error encoding arguments: ' + e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment