jamesknelson / gulp-rev-replace

Rewrite occurences of filenames which have been renamed by gulp-rev
MIT License
388 stars 62 forks source link

Fix `byLongestUnreved` behavior #24

Closed gsong closed 9 years ago

gsong commented 9 years ago

Fix the compare function according to JS spec: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort.

If you revert the comparison function to how it was before, the test fails:

function byLongestUnreved(a, b) {
  return a.unreved.length < b.unreved.length;
}
jamesknelson commented 9 years ago

Thanks @gsong!