Skip to content

Commit cd72769

Browse files
Make vars act exactly like python client
1 parent 8ccd363 commit cd72769

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

lib/query/woqlCore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// /@ts-check
1515
const UTILS = require('../utils');
1616
const WOQLPrinter = require('./woqlPrinter');
17-
const { Var, Doc } = require('./woqlDoc');
17+
const { Var, Vars, Doc } = require('./woqlDoc');
1818

1919
/**
2020
* defines the internal functions of the woql query object - the

lib/query/woqlDoc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,11 @@ function Doc(obj) {
7474
this.doc = obj;
7575
this.encoded = convert(obj);
7676
}
77-
module.exports = { Var, Doc };
77+
78+
function Vars() {
79+
for(let k of arguments){
80+
this[k] = new Var(k)
81+
}
82+
}
83+
84+
module.exports = { Vars, Var, Doc };

lib/query/woqlQuery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// /@ts-check
1313
// WOQLQuery
1414
const WOQLQuery = require('./woqlCore');
15-
const { Var, Doc } = require('./woqlDoc');
15+
const { Var, Vars, Doc } = require('./woqlDoc');
1616

1717
// I HAVE TO REVIEW THE Inheritance and the prototype chain
1818
/* class WOQLQuery extends WOQLCore {

lib/woql.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// /@ts-check
44
// I HAVE TO REVIEW THE Inheritance and the prototype chain
55
const WOQLQuery = require('./query/woqlBuilder');
6-
const { Var, Doc } = require('./query/woqlDoc');
6+
const { Vars, Var, Doc } = require('./query/woqlDoc');
77
/**
88
* @license Apache Version 2
99
* @module WOQL

0 commit comments

Comments
 (0)