atIndex option currently accepts numbers only.
To remove the hassle of finding the parent again, to get its children length, and use it to find the last length,
It's better to just mention atIndex: "LAST"
goal:
tree.moveUnderParent({
node: (node) => node.model._id === "A",
toParent: (node) => node.model._id === "B",
atIndex: "LAST",
})