We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00e2cb8 commit 0e8d163Copy full SHA for 0e8d163
src/preview.ts
@@ -272,9 +272,8 @@ export class PreviewServer {
272
this._dag.get(caller)!.add(path);
273
const seen = new Set<string>();
274
const q = [caller];
275
- while (true) {
276
- const node = q.shift();
277
- if (!node) return;
+ while (q.length) {
+ const node = q.shift()!;
278
if (seen.has(node))
279
throw new Error(`${red("Circular dependency detected")}: ${[...seen, node].map(bold).join(" ← ")}`);
280
q.push(...(this._dag.get(node) ?? []));
0 commit comments