修复了2个bug

This commit is contained in:
andy committed 2026-09-02 17:02:02 +08:00
1 parent ce8372e878
commit 2a64dc7395
64 files changed
+1050 -39

No files matched your search

+13
View File
@@ -26,3 +26,16 @@ export type SeedreamLayerComposition = {
};
export type SeedreamLayerDraft = Pick<SeedreamLayerComposition, "baseAssetId" | "baseVisible" | "layers">;
export function hasCompleteSeedreamLayerMetadata(records: unknown[], outputCount: number): boolean {
if (!Number.isInteger(outputCount) || outputCount < 2 || records.length !== outputCount) return false;
const indices = records.map((value) => {
if (!value || typeof value !== "object" || Array.isArray(value)) return undefined;
const raw = (value as Record<string, unknown>).z_index;
const index = typeof raw === "number" ? raw : typeof raw === "string" && raw.trim() ? Number(raw) : Number.NaN;
return Number.isInteger(index) && index >= 0 ? index : undefined;
});
if (indices.some((index) => index === undefined)) return false;
const numericIndices = indices as number[];
return numericIndices.includes(0) && new Set(numericIndices).size === numericIndices.length;
}