code: function findItem( path, items ) {
    var result = null;
    items.forEach( function ( item ) {
      if (!result && item instanceof MenuItem && item.paths.filter( function( value ) {
          return value === path;
        } ).length > 0)
        result = item;
      if (!result && item instanceof MenuNode) {
        var child = findItem( path, item.children );
        if (child)
          result = child;
      }
    } );
    return result;
  }
docs: region Helper methods