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:
2Pacalypse- 2017-05-27 21:06:37 +02:00 committed by Brian C
parent dbf3bd3304
commit c2af53a24e

View File

@ -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]));