code: function buildOrderedPatterns(collection) {
    let sortedKeys;
    if (hasPatternOrdering(collection.items)) {
      sortedKeys = Object.keys(collection.items).sort((keyA, keyB) => {
        const orderA = collection.items[keyA].data.order || 0;
        const orderB = collection.items[keyB].data.order || 0;
        return orderA - orderB;
      });
    } else {
      sortedKeys = [];
    }
    const patterns = [];
    sortedKeys = sortedKeys.concat(
      Object.keys(collection.items).filter(itemKey => {
        // Make sure all keys are accounted for
        return sortedKeys.indexOf(itemKey) < 0;
      })
    );
    sortedKeys.forEach(sortedKey => {
      if (!isHidden(collection, collection.items[sortedKey], sortedKey)) {
        patterns.push(collection.items[sortedKey]);
      }
    });
    return patterns;
  }
docs: Transform the `collection`'s `items` (all patterns, unordered) into
  an {Array} of ordered, visible patterns that should be rendered as part
  of this collection. Check both individual pattern files and collection
  metadata for ordering information, as well as information about hidden
  patterns.
  
  @param {Object} collection
  @return {Array} patterns            Ordered, visible patterns