summaryrefslogtreecommitdiff
path: root/front/src/logic/trill/helpers.ts
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-09-18 08:26:30 +0700
committerpolwex <polwex@sortug.com>2025-09-18 08:26:30 +0700
commit7bac4927e8895719a91011da9a2b997579238145 (patch)
tree8b47f7370718e874af9a292a1b8e0e09555f3990 /front/src/logic/trill/helpers.ts
parent0549cfd01f1feed9c313a84a3884328d08887caf (diff)
damn my trill codebase was really something
Diffstat (limited to 'front/src/logic/trill/helpers.ts')
-rw-r--r--front/src/logic/trill/helpers.ts10
1 files changed, 10 insertions, 0 deletions
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),
+ };
+}