Skip to content

Commit 645f86d

Browse files
authored
🤖 Merge PR DefinitelyTyped#72903 n3: Accept undefined as a type predicate argument by @opl-
1 parent 133f118 commit 645f86d

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

‎types/n3/index.d.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,11 @@ export interface StoreOptions {
379379
}
380380

381381
export namespace Util {
382-
function isNamedNode(value: RDF.Term | null): value is RDF.NamedNode;
383-
function isBlankNode(value: RDF.Term | null): value is RDF.BlankNode;
384-
function isLiteral(value: RDF.Term | null): value is RDF.Literal;
385-
function isVariable(value: RDF.Term | null): value is RDF.Variable;
386-
function isDefaultGraph(value: RDF.Term | null): value is RDF.DefaultGraph;
382+
function isNamedNode(value: RDF.Term | null | undefined): value is RDF.NamedNode;
383+
function isBlankNode(value: RDF.Term | null | undefined): value is RDF.BlankNode;
384+
function isLiteral(value: RDF.Term | null | undefined): value is RDF.Literal;
385+
function isVariable(value: RDF.Term | null | undefined): value is RDF.Variable;
386+
function isDefaultGraph(value: RDF.Term | null | undefined): value is RDF.DefaultGraph;
387387
function inDefaultGraph(value: RDF.Quad): boolean;
388388
function prefix(iri: RDF.NamedNode | string, factory?: RDF.DataFactory): PrefixedToIri;
389389
function prefixes(

‎types/n3/n3-tests.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,18 @@ function test_doc_utility() {
467467
if (N3Util.isDefaultGraph(term)) {
468468
const defaultGraphTerm: RDF.DefaultGraph = term;
469469
}
470+
471+
N3Util.isNamedNode(null);
472+
N3Util.isBlankNode(null);
473+
N3Util.isLiteral(null);
474+
N3Util.isVariable(null);
475+
N3Util.isDefaultGraph(null);
476+
477+
N3Util.isNamedNode(undefined);
478+
N3Util.isBlankNode(undefined);
479+
N3Util.isLiteral(undefined);
480+
N3Util.isVariable(undefined);
481+
N3Util.isDefaultGraph(undefined);
470482
}
471483

472484
function test_parser_options() {

0 commit comments

Comments
 (0)