import type { Id } from '@tmagic/core'; import { getKeys } from '@tmagic/utils'; import type { LayerNodeStatus } from '@editor/type'; export const updateStatus = (nodeStatusMap: Map, id: Id, status: Partial) => { const nodeStatus = nodeStatusMap.get(id); if (!nodeStatus) return; getKeys(status).forEach((key) => { if (nodeStatus[key] !== undefined && status[key] !== undefined) { nodeStatus[key] = Boolean(status[key]); } }); };