Snip test (#3204)
* fix: index * fix: snapshot error; perf: snapshot diff compare * perf: init simple edit history
This commit is contained in:
@@ -8,11 +8,14 @@ const createWorkflowDiffPatcher = () =>
|
||||
|
||||
const diffPatcher = createWorkflowDiffPatcher();
|
||||
|
||||
export const createDiff = <T extends Record<string, unknown>>(initialState?: T, newState?: T) => {
|
||||
export const getAppDiffConfig = <T extends Record<string, unknown>>(
|
||||
initialState?: T,
|
||||
newState?: T
|
||||
) => {
|
||||
return diffPatcher.diff(initialState, newState);
|
||||
};
|
||||
|
||||
export const applyDiff = <T extends Record<string, unknown>>(
|
||||
export const getAppConfigByDiff = <T extends Record<string, unknown>>(
|
||||
initialState?: T,
|
||||
diff?: ReturnType<typeof diffPatcher.diff>
|
||||
) => {
|
||||
|
||||
@@ -633,12 +633,11 @@ export const compareSnapshot = (
|
||||
};
|
||||
|
||||
// remove node size
|
||||
export const simplifyNodes = (nodes: Node[]) => {
|
||||
export const simplifyWorkflowNodes = (nodes: Node[]) => {
|
||||
return nodes.map((node) => ({
|
||||
id: node.id,
|
||||
type: node.type,
|
||||
position: node.position,
|
||||
data: node.data,
|
||||
zIndex: node.zIndex
|
||||
data: node.data
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user