Gruntfile.js
function levelSorter(a, b) {
  var l = Math.max(a.length, b.length)
  for (var i = 0; i < l; i += 1) {
    if (!(i in a)) return +1
    if (!(i in b)) return -1

    if (a.length < b.length) return +1
    if (a.length > b.length) return -1
  }
}
function levelSorter(a, b) {
  var l = Math.max(a.length, b.length)
  for (var i = 0; i < l; i += 1) {
    if (!(i in a)) return +1
    if (!(i in b)) return -1

    if (a.length < b.length) return +1
    if (a.length > b.length) return -1
  }
}
function levelSorter ( a , b ) { var l = Math . max ( a . length , b . length ) for ( var i = 0 ; i < l ; i += 1 ) { if ( ! ( i in a ) ) return + 1 if ( ! ( i in b ) ) return - 1 if ( a . length < b . length ) return + 1 if ( a . length > b . length ) return - 1 } }
Level-order sort of a list of paths
Level - order sort of a list of paths