summaryrefslogtreecommitdiff
path: root/front/src/logic/trill/helpers.ts
blob: 6b5a1388b77362f6c57398a951ecfefcce531fcb (plain)
1
2
3
4
5
6
7
8
9
10
import type { FullNode, Poast } from "@/types/trill";

export function toFlat(n: FullNode): Poast {
  return {
    ...n,
    children: !n.children
      ? []
      : Object.keys(n.children).map((c) => n.children[c].id),
  };
}