Skip to content

Commit 29c3497

Browse files
Merge pull request #89 from terminusdb/local
fix vars definition #72
2 parents 0144bab + 1e32ee4 commit 29c3497

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

lib/query/woqlCore.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
const UTILS = require('../utils')
33
const WOQLPrinter = require('./woqlPrinter')
44

5-
function convert(obj){
5+
6+
function convert(obj){
67
if (obj == null){
78
return null
89
} else if (typeof(obj) == 'number'){
@@ -29,10 +30,13 @@ function convert(obj){
2930
}
3031
}
3132

32-
function Var(name) { this.name = name }
33-
function Doc(obj) {
34-
this.doc = obj
35-
this.encoded = convert(obj)
33+
export function Var(name){
34+
this.name = name
35+
}
36+
37+
export function Doc(obj) {
38+
this.doc = obj
39+
this.encoded = convert(obj)
3640
}
3741

3842
/**

lib/woql.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//I HAVE TO REVIEW THE Inheritance and the prototype chain
33
const typedef = require('./typedef')
44
const WOQLQuery = require('./query/woqlBuilder')
5-
5+
const {Var} = require("./query/woqlCore")
66
/**
77
* @license Apache Version 2
88
* @module WOQL
@@ -1188,9 +1188,10 @@ WOQL.iri = function(val) {
11881188
*/
11891189

11901190
WOQL.vars = function(...varNames) {
1191-
return varNames.map(item => Var(item))
1191+
return varNames.map(item => new Var(item))
11921192
}
11931193

1194+
11941195
/**
11951196
* Gets/Sets woqlClient
11961197
* @param {WOQLClient}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"babel-loader": "^8.0.6",
3030
"chai": "^4.3.4",
3131
"coveralls": "^3.1.1",
32-
"docsify-cli": "^4.4.3",
33-
"eslint": "7.9.0",
32+
"docsify-cli": "^4.4.2",
33+
"eslint": "^7.32.0",
3434
"eslint-config-prettier": "6.11.0",
3535
"eslint-plugin-prettier": "3.1.3",
3636
"html-webpack-plugin": "^5.3.1",
@@ -42,7 +42,7 @@
4242
"typescript": "^4.2.3",
4343
"webpack": "^5.36.2",
4444
"webpack-cli": "^4.6.0",
45-
"webpack-dev-server": "^3.11.2"
45+
"webpack-dev-server": "^4.6.0"
4646
},
4747
"scripts": {
4848
"mkdocs:multi": "node ./docs/createDocs.js",

0 commit comments

Comments
 (0)