Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix mergeHook when parentVal is not an array #10877
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
If adding a new feature, the PR's description includes:
This is related to a vue-router issue.
A bit of context:
VueRouter comes with 3 hooks (beforeRouteEnter, beforeRouteLeave, beforeRouteUpdate).
As you can see in the code, mergeHook is expecting a different type parentVal or childVal. If parentVal ends up not being an array, the code crashes.
The fix we propose is to put parentVal into an array before calling concat, if parentVal is not an array.