feat: some tweaks
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m41s

This commit is contained in:
2024-05-03 01:33:55 +02:00
parent 4c235fe24a
commit cf5b36490f
8 changed files with 235 additions and 211 deletions

View File

@ -11,6 +11,8 @@ const logger = createLogger("graph-manager");
logger.mute();
const clone = "structuredClone" in self ? self.structuredClone : (args: any) => JSON.parse(JSON.stringify(args));
function areSocketsCompatible(output: string | undefined, inputs: string | string[] | undefined) {
if (Array.isArray(inputs) && output) {
return inputs.includes(output);
@ -67,7 +69,7 @@ export class GraphManager extends EventEmitter<{ "save": Graph, "result": any, "
const serialized = { id: this.graph.id, settings: this.settings, nodes, edges };
logger.groupEnd();
return serialized;
return clone(serialized);
}