Skip to content

Commit c2af53a

Browse files
2Pacalypse-brianc
authored andcommitted
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.
1 parent dbf3bd3 commit c2af53a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/utils.js

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ function arrayString(val) {
3333
else if(Array.isArray(val[i])) {
3434
result = result + arrayString(val[i]);
3535
}
36+
else if(val[i] instanceof Buffer) {
37+
result += '\\\\x' + val[i].toString('hex');
38+
}
3639
else
3740
{
3841
result += escapeElement(prepareValue(val[i]));

0 commit comments

Comments
 (0)