fix(rdf-js): match should allow null on optional parameters (#41012)

This commit is contained in:
Tomasz Pluskiewicz
2019-12-13 10:39:05 +00:00
committed by Orta
parent 02549c083e
commit f7f904f320
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -465,7 +465,7 @@ export interface DatasetCore<Q extends BaseQuad = Quad> {
* @param object The optional exact object to match.
* @param graph The optional exact graph to match.
*/
match(subject?: Term, predicate?: Term, object?: Term, graph?: Term): this;
match(subject?: Term | null, predicate?: Term | null, object?: Term | null, graph?: Term | null): this;
[Symbol.iterator](): Iterator<Q>;
}
+4
View File
@@ -147,6 +147,10 @@ function test_datasetcore() {
const dataset2Match3: DatasetCore = dataset2.match(term, term);
const dataset2Match4: DatasetCore = dataset2.match(term, term, term);
const dataset2Match5: DatasetCore = dataset2.match(term, term, term, term);
const dataset2MatchWithNull1: DatasetCore = dataset2.match(term);
const dataset2MatchWithNull2: DatasetCore = dataset2.match(null, term);
const dataset2MatchWithNull3: DatasetCore = dataset2.match(term, null, term);
const dataset2MatchWithNull4: DatasetCore = dataset2.match(term, term, null, term);
const dataset2Iterable: Iterable<Quad> = dataset2;
const dataset3Size: number = dataset3.size;