From 7bac4927e8895719a91011da9a2b997579238145 Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 18 Sep 2025 08:26:30 +0700 Subject: damn my trill codebase was really something --- front/src/logic/trill/helpers.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 front/src/logic/trill/helpers.ts (limited to 'front/src/logic/trill') diff --git a/front/src/logic/trill/helpers.ts b/front/src/logic/trill/helpers.ts new file mode 100644 index 0000000..6b5a138 --- /dev/null +++ b/front/src/logic/trill/helpers.ts @@ -0,0 +1,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), + }; +} -- cgit v1.2.3