From 894c60e605eadc918f819477c3ced4c67f87e568 Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Mon, 21 Oct 2013 13:29:17 -0500 Subject: [PATCH] Accept anything with function 'submit' as a query This allows for passing in custom objects which conform to the query API --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index c5ae4294..aa60f6f1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -284,7 +284,7 @@ Client.prototype.copyTo = function (text) { Client.prototype.query = function(config, values, callback) { //can take in strings, config object or query object - var query = (config instanceof Query) ? config : + var query = (typeof config.submit == 'function') ? config : new Query(config, values, callback); if(this.binary && !query.binary) { query.binary = true;