# HG changeset patch # User drewp@bigasterisk.com # Date 2023-05-30 08:01:53 # Node ID 6529768a96a2bdfc4b2b2c7296ed2cae5d1a51a5 # Parent d1858647682725fc4df311ed7a9520f7d7ed61f8 stronger types diff --git a/light9/web/SyncedGraph.ts b/light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts +++ b/light9/web/SyncedGraph.ts @@ -365,10 +365,11 @@ export class SyncedGraph { 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);