'use strict'; module.exports = function findAlignment(item) { if (item.tags == null) { return null; } else { let alignmentTags = item.tags.filter(tag => tag.type === "alignment"); if (alignmentTags.length > 0) { /* We always want the last-specified alignment tag. */ // FIXME: Throw an error upon encountering nested alignment tags... return alignmentTags[alignmentTags.length - 1].alignment; } else { return null; } } };