Skip to content

Commit

Permalink
Merge pull request #648 from retejs/fix/nodes-connections-list
Browse files Browse the repository at this point in the history
fix(editor): return copy of array in getNodes/getConnections
  • Loading branch information
Ni55aN authored Jul 24, 2023
2 parents f77e567 + 369e85e commit baa7397
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ export class NodeEditor<Scheme extends BaseSchemes> extends Scope<Root<Scheme>>

/**
* Get all nodes
* @returns All nodes
* @returns Copy of array with nodes
*/
public getNodes() {
return this.nodes
return this.nodes.slice()
}

/**
* Get all connections
* @returns All connections
* @returns Copy of array with onnections
*/
public getConnections() {
return this.connections
return this.connections.slice()
}

/**
Expand Down

0 comments on commit baa7397

Please sign in to comment.