# HG changeset patch # User drewp@bigasterisk.com # Date 1685433713 25200 # Node ID 6529768a96a2bdfc4b2b2c7296ed2cae5d1a51a5 # Parent d1858647682725fc4df311ed7a9520f7d7ed61f8 stronger types diff -r d18586476827 -r 6529768a96a2 light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts Tue May 30 01:01:40 2023 -0700 +++ b/light9/web/SyncedGraph.ts Tue May 30 01:01:53 2023 -0700 @@ -365,10 +365,11 @@ return this.nextNumberedResources(base, 1)[0]; } - contextsWithPattern(s: any, p: any, o: any) { + contextsWithPattern(s: Quad_Subject | null, p: Quad_Predicate | null, o: Quad_Object | null): N3.NamedNode[] { this.autoDeps.askedFor(s, p, o, null); - const ctxs = []; + const ctxs: N3.NamedNode[] = []; for (let q of Array.from(this.graph.getQuads(s, p, o, null))) { + if (q.graph.termType != "NamedNode") throw `context was ${q.graph.id}`; ctxs.push(q.graph); } return unique(ctxs);