packages/solver/lib/simplifyExpression/functionsSearch/nthRoot.js
function getRootNode(node) {
  if (!Node.Type.isFunction(node, 'nthRoot')) {
    throw Error('Expected nthRoot');
  }

  return node.args.length === 2 ? node.args[1] : Node.Creator.constant(2);
}
function getRootNode(node) {
  if (!Node.Type.isFunction(node, 'nthRoot')) {
    throw Error('Expected nthRoot');
  }

  return node.args.length === 2 ? node.args[1] : Node.Creator.constant(2);
}
function getRootNode ( node ) { if ( ! Node . Type . isFunction ( node , 'nthRoot' ) ) { throw Error ( 'Expected nthRoot' ) ; } return node . args . length === 2 ? node . args [ 1 ] : Node . Creator . constant ( 2 ) ; }
Given an nthRoot node, will return the root node. The root node is the second child of the nthRoot node, but if one doesn't exist, we assume it's a square root and return 2.
Given an nthRoot node will return the root node . The root node is the second child of the nthRoot node but if one doesn t exist we assume it s a square root and return 2 .