Skip to content

Commit

Permalink
Merge pull request #203 from carloslfu/fix-issue-202
Browse files Browse the repository at this point in the history
Fix getStateNodeByPath method argument mutation
  • Loading branch information
davidkpiano committed Oct 18, 2018
2 parents 93ff9f2 + 53bb04f commit 1cf76b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StateNode.ts
Expand Up @@ -1235,7 +1235,7 @@ class StateNode<
* @param statePath The string or string array relative path to the state node.
*/
public getStateNodeByPath(statePath: string | string[]): StateNode<TContext> {
const arrayStatePath = toStatePath(statePath, this.delimiter);
const arrayStatePath = toStatePath(statePath, this.delimiter).slice();
let currentStateNode: StateNode<TContext> = this;
while (arrayStatePath.length) {
const key = arrayStatePath.shift()!;
Expand Down

0 comments on commit 1cf76b7

Please sign in to comment.