Skip to content

Commit d4a95bb

Browse files
added support for v: variables in woql.doc (#181)
Signed-off-by: NeelParihar <[email protected]>
1 parent 0f7c586 commit d4a95bb

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/query/woqlDoc.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@ function convert(obj) {
1919
},
2020
};
2121
} if (typeof (obj) === 'string') {
22+
if (obj.indexOf('v:') === -1) {
23+
return {
24+
'@type': 'Value',
25+
data: {
26+
'@type': 'xsd:string',
27+
'@value': obj,
28+
},
29+
};
30+
}
31+
2232
return {
2333
'@type': 'Value',
24-
data: {
25-
'@type': 'xsd:string',
26-
'@value': obj,
27-
},
34+
variable: obj.split(':')[1],
2835
};
36+
2937
// eslint-disable-next-line no-use-before-define
3038
} if (obj instanceof Var) {
3139
return {

0 commit comments

Comments
 (0)