Skip to content

Commit

Permalink
Merge pull request #48 from Trakkasure/bugfix/arg-sending-bug
Browse files Browse the repository at this point in the history
Fixed error when sending commands, and args already include proper encoding.
  • Loading branch information
Trakkasure committed Aug 26, 2017
2 parents a1fd5f9 + 1ab745b commit 8863c39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Util.js
Expand Up @@ -178,7 +178,9 @@ function getUnwrappedPromise() {

function objToAPIParams(obj,type) {
const prefix=type==='print'?'?':'=';
return Object.keys(obj).map(k=>obj[k]?`${prefix}${k}=${obj[k]}`:`${prefix}${k}`);
const t=RegExp("[a-zA-Z]");
return Object.keys(obj)
.map(k=>obj[k]?`${t.test(k[0])?prefix:""}${k}=${obj[k]}`:`${t.test(k[0])?prefix:""}${k}`);
}

function resultsToObj(r) {
Expand Down

0 comments on commit 8863c39

Please sign in to comment.