chore: address code quality audit findings
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled

This commit is contained in:
Tom Boullay
2026-05-28 08:31:42 +02:00
parent 947025cbf5
commit d654565f87
73 changed files with 890 additions and 1457 deletions
+2 -18
View File
@@ -1,4 +1,4 @@
import type { HierarchicalMapNode, MapNode } from "../../types/editor/editor";
import type { HierarchicalMapNode, MapNode } from "@/types/map/mapScene";
export interface ParsedMapNodes {
mapNodes: MapNode[];
@@ -31,9 +31,7 @@ function isMapNode(value: unknown): value is MapNode {
);
}
export function isHierarchicalMapNode(
value: unknown,
): value is HierarchicalMapNode {
function isHierarchicalMapNode(value: unknown): value is HierarchicalMapNode {
if (!isMapNode(value)) {
return false;
}
@@ -74,20 +72,6 @@ function flattenMapNode(node: HierarchicalMapNode, path: number[]): MapNode[] {
return [mapNode, ...childNodes];
}
export function parseHierarchicalMapPayload(
value: unknown,
): HierarchicalMapNode | HierarchicalMapNode[] {
if (Array.isArray(value) && value.every(isHierarchicalMapNode)) {
return value;
}
if (isHierarchicalMapNode(value)) {
return value;
}
throw new Error("Invalid map node data");
}
export function parseMapNodes(value: unknown): MapNode[] {
return parseMapData(value).mapNodes;
}