Skip to content

Commit 76bc0dc

Browse files
authored
Merge pull request #327 from hoijnet/issue/325-literal-value-zero
Issue/325 literal value zero which looks accurate, but adding significant test battery instead
2 parents 389cf69 + f8dc885 commit 76bc0dc

26 files changed

+10833
-57
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@v4
3232
- uses: actions/setup-node@v4
3333
with:
34-
node-version: 18
34+
node-version: 20
3535
- name: Run terminusdb server
3636
run: |
3737
docker run --detach --publish 127.0.0.1:6363:6363 terminusdb/terminusdb-server:dev && sleep 10

docs/helper/format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ exports.isDeprecated = function () {
117117
exports.navItemAnchor = function () {
118118
if (typeof this.label === 'string') {
119119
const anchorName = this.label.replace(/ /g, '-');
120-
return anchorName.toLowerCase();
120+
return anchorName?.toLowerCase();
121121
}
122122
return this.name;
123123
};

lib/query/woqlBuilder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ WOQLQuery.prototype.boolean = function (tf) {
8686
};
8787

8888
/**
89-
* @param {any} s
90-
* @param {string} t
91-
* @returns {object}
89+
* @param {any} s - the value of the literal
90+
* @param {string} t - the type of the literal, e.g. 'xsd:string', 'xsd:boolean'
91+
* @returns {object} - a WOQL DataValue object with the given type and value
9292
*/
9393
WOQLQuery.prototype.literal = function (s, t) {
9494
t = t.indexOf(':') === -1 ? `xsd:${t}` : t;

lib/woql.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,17 @@ WOQL.equals = function (varName, varValue) {
312312
};
313313

314314
/**
315-
* Substring
315+
* Substring of string
316316
* @param {string|Var} string - String or variable
317317
* @param {number|Var} before - integer or variable (characters from start to begin)
318318
* @param {number|Var} [length] - integer or variable (length of substring)
319319
* @param {number|Var} [after] - integer or variable (number of characters after substring)
320320
* @param {string|Var} [substring] - String or variable
321321
* @returns {WOQLQuery}
322+
* @example
323+
* let [after, result] = vars("after", "result")
324+
* substr("joe", 1, 2, after, result)
325+
* //result is "oe", after is 2
322326
*/
323327

324328
WOQL.substr = function (string, before, length, after, substring) {

0 commit comments

Comments
 (0)