Properly insert buffers in arrays.
Before this commit, when someone tried to insert a Buffer into an array, the library would try to escape it (by calling the `escapeElement` on it), which would fail because buffers don't have a `replace` method.
This commit is contained in:
parent
dbf3bd3304
commit
c2af53a24e
@ -33,6 +33,9 @@ function arrayString(val) {
|
||||
else if(Array.isArray(val[i])) {
|
||||
result = result + arrayString(val[i]);
|
||||
}
|
||||
else if(val[i] instanceof Buffer) {
|
||||
result += '\\\\x' + val[i].toString('hex');
|
||||
}
|
||||
else
|
||||
{
|
||||
result += escapeElement(prepareValue(val[i]));
|
||||
|
Loading…
Reference in New Issue
Block a user