lib/core/tasks.js
function(node, lines, parentName, depth) {

    // Default depth.
    if (_.isUndefined(depth)) {
      depth = 0;
    }

    // Default parentName.
    if (_.isUndefined(parentName)) {
      parentName = 'root';
    }

    if (isTask(node)) {

      // This is a task so add to lines and nothing further.
      lines.push({
        depth: depth,
        name: getName(node),
        parentName: parentName,
        description: node.description
      });

    } else if (isBranch(node)) {

      lines.push({
        depth: depth,
        name: getName(node),
        parentName: parentName
      });
      node.children.forEach(function(child) {
        recAdd(child, lines, getName(node), depth + 1);
      });

    } else {

      // This should never happen.
      assert(false);

    }

  }
function(node, lines, parentName, depth) {

    // Default depth.
    if (_.isUndefined(depth)) {
      depth = 0;
    }

    // Default parentName.
    if (_.isUndefined(parentName)) {
      parentName = 'root';
    }

    if (isTask(node)) {

      // This is a task so add to lines and nothing further.
      lines.push({
        depth: depth,
        name: getName(node),
        parentName: parentName,
        description: node.description
      });

    } else if (isBranch(node)) {

      lines.push({
        depth: depth,
        name: getName(node),
        parentName: parentName
      });
      node.children.forEach(function(child) {
        recAdd(child, lines, getName(node), depth + 1);
      });

    } else {

      // This should never happen.
      assert(false);

    }

  }
function ( node , lines , parentName , depth ) { // Default depth. if ( _ . isUndefined ( depth ) ) { depth = 0 ; } // Default parentName. if ( _ . isUndefined ( parentName ) ) { parentName = 'root' ; } if ( isTask ( node ) ) { // This is a task so add to lines and nothing further. lines . push ( { depth : depth , name : getName ( node ) , parentName : parentName , description : node . description } ) ; } else if ( isBranch ( node ) ) { lines . push ( { depth : depth , name : getName ( node ) , parentName : parentName } ) ; node . children . forEach ( function ( child ) { recAdd ( child , lines , getName ( node ) , depth + 1 ) ; } ) ; } else { // This should never happen. assert ( false ) ; } }
Recursively build list of lines.
Recursively build list of lines .