docs: function flattenNavigation (nav, hasParent, flattened) {
  
      flattened = flattened || [];
  
      // loop through each navigation item
      for (var i = 0; i < nav.length; i++) {
  
          var _nav = utils.cloneWithout(nav[i], 'children');
  
          if (hasParent) {
              _nav.parent = hasParent;
          }
  
          flattened.push(_nav);
  
          if (nav[i].children) {
              flattened = flattenNavigation(nav[i].children, _nav, flattened);
          }
  
      }
  
      return flattened;
  
  }