"use strict"; module.exports = function pickBestOption(a, b) { if (a == null || a.priority == null) { return b; } else if (b == null || b.priority == null) { return a; } else if (b.priority > a.priority) { return b; } else { // NOTE: We return the second (ie. new) one in the case of a 'tie', to deal with eg. normalization code improvements return b; } };