Skip to content

Commit 09b429d

Browse files
fixed bug with woql pretty print
1 parent c85055e commit 09b429d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/woql.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ WOQLQuery.prototype.prettyPrint = function(indent, show_context, q, embed){
285285
}
286286
else {
287287
if(typeof val[i] == "string"){
288-
nvals.push('"' + self.unclean(val[i]) + '"');
288+
nvals.push(self.unclean(val[i]));
289289
}
290290
else if(typeof val[i] == "object"){
291291
nvals.push(JSON.stringify(val[i]));
@@ -297,8 +297,8 @@ WOQLQuery.prototype.prettyPrint = function(indent, show_context, q, embed){
297297
}
298298
if(nvals.length){
299299
str += unclean(nvals);
300-
if(key == "from") str += ")\n .";
301-
else str +=").";
300+
if(key == "from") str += "\n .";
301+
else str +=".";
302302
}
303303
else {
304304
str += "().";

lib/woqlResult.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ const FrameHelper = require("./frameHelper");
22

33
function WOQLResult(results, query, config){
44
this.bindings = results.bindings;
5-
this.query = query;
5+
if(query.constructor.name == "WOQLQuery"){
6+
this.query = query;
7+
}
8+
else {
9+
this.query = query.query;
10+
}
611
this.cursor = 0;
712
if(!(config && config.no_compress)){
813
var context = (config && config.context ? config.context : false);

0 commit comments

Comments
 (0)