Skip to content

Commit 784a127

Browse files
authored
🤖 Merge PR DefinitelyTyped#72904 n3: Fix addQuad and removeQuad don't return boolean by @opl-
1 parent 645f86d commit 784a127

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

‎types/n3/index.d.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ export class Store<
319319
object: Q_RDF["object"],
320320
graph?: Q_RDF["graph"],
321321
done?: () => void,
322-
): void;
323-
addQuad(quad: Q_RDF): void;
322+
): boolean;
323+
addQuad(quad: Q_RDF): boolean;
324324
addQuads(quads: Q_RDF[]): void;
325325
delete(quad: InQuad): this;
326326
has(quad: InQuad): boolean;
@@ -331,8 +331,8 @@ export class Store<
331331
object: Q_RDF["object"],
332332
graph?: Q_RDF["graph"],
333333
done?: () => void,
334-
): void;
335-
removeQuad(quad: Q_RDF): void;
334+
): boolean;
335+
removeQuad(quad: Q_RDF): boolean;
336336
removeQuads(quads: Q_RDF[]): void;
337337
remove(stream: RDF.Stream<Q_RDF>): EventEmitter;
338338
removeMatches(

‎types/n3/n3-tests.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,21 +313,22 @@ function test_doc_blank_nodes_and_lists() {
313313
}
314314

315315
function test_doc_storing() {
316+
let result: boolean = false;
316317
const store: N3.Store = new N3.Store();
317-
store.addQuad(
318+
result = store.addQuad(
318319
N3.DataFactory.namedNode("http://ex.org/Pluto"),
319320
N3.DataFactory.namedNode("http://ex.org/type"),
320321
N3.DataFactory.namedNode("http://ex.org/Dog"),
321322
);
322-
store.addQuad(
323+
result = store.addQuad(
323324
N3.DataFactory.namedNode("http://ex.org/Pluto"),
324325
N3.DataFactory.namedNode("http://ex.org/type"),
325326
// @ts-expect-error
326327
[
327328
N3.DataFactory.namedNode("http://ex.org/Dog"),
328329
],
329330
);
330-
store.addQuad(
331+
result = store.addQuad(
331332
N3.DataFactory.quad(
332333
N3.DataFactory.namedNode("http://ex.org/Mickey"),
333334
N3.DataFactory.namedNode("http://ex.org/type"),
@@ -341,20 +342,20 @@ function test_doc_storing() {
341342
N3.DataFactory.namedNode("http://ex.org/Mouse"),
342343
),
343344
]);
344-
store.removeQuad(
345+
result = store.removeQuad(
345346
N3.DataFactory.namedNode("http://ex.org/Mickey"),
346347
N3.DataFactory.namedNode("http://ex.org/type"),
347348
N3.DataFactory.namedNode("http://ex.org/Mouse"),
348349
);
349-
store.removeQuad(
350+
result = store.removeQuad(
350351
N3.DataFactory.namedNode("http://ex.org/Mickey"),
351352
N3.DataFactory.namedNode("http://ex.org/type"),
352353
// @ts-expect-error
353354
[
354355
N3.DataFactory.namedNode("http://ex.org/Mouse"),
355356
],
356357
);
357-
store.removeQuad(
358+
result = store.removeQuad(
358359
N3.DataFactory.quad(
359360
N3.DataFactory.namedNode("http://ex.org/Mickey"),
360361
N3.DataFactory.namedNode("http://ex.org/type"),

0 commit comments

Comments
 (0)