• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yunnysunny / bookforge / 20639889242

01 Jan 2026 02:03PM UTC coverage: 55.087% (-36.6%) from 91.667%
20639889242

push

github

web-flow
feat: add notion support

27 of 51 branches covered (52.94%)

Branch coverage included in aggregate %.

75 of 221 new or added lines in 12 files covered. (33.94%)

195 of 352 relevant lines covered (55.4%)

23.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/utils/relation.ts
1
export type ParentId = string;
2
export type ChildId = string;
3
export interface Child {
4
  childId: ChildId;
5
  relativePath: string;
6
}
7
export interface Relation extends Child {
8
  parentId: ParentId;
9
}
10
export class RelationManager {
11
  private parent2Children: Map<ParentId, Child[]>;
12
  // private child2Parent: Map<ChildId, ParentId>;
13
  constructor() {
NEW
14
    this.parent2Children = new Map();
×
15
    // this.child2Parent = new Map();
16
  }
17
  addRelation(relation: Relation) {
NEW
18
    const { parentId, ...rest } = relation;
×
NEW
19
    this.parent2Children.set(parentId, [
×
20
      ...(this.parent2Children.get(parentId) || []),
21
      rest,
22
    ]);
23
  }
24
  getTopEntities(): ParentId[] {
NEW
25
    const map = new Map(this.parent2Children);
×
NEW
26
    for (const [_, children] of map.entries()) {
×
NEW
27
      children.forEach((child) => {
×
NEW
28
        map.delete(child.childId);
×
29
      });
30
    }
NEW
31
    return Array.from(map.keys());
×
32
  }
33
  getChildren(parentId: ParentId): Child[] {
NEW
34
    return this.parent2Children.get(parentId) || [];
×
35
  }
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc