index.js
function splice(array, criteria, tieBreakers) {
  if (!criteria) { criteria = returnFalse; }
  var matcher = anymatch(criteria);
  var matched = array.filter(matcher);
  var unmatched = array.filter(function(s) {
    return matched.indexOf(s) === -1;
  }).sort();
  if (!Array.isArray(criteria)) { criteria = [criteria]; }
  // use [].concat.apply because criteria may or may not be an array
  matched = matched.sort(anysort([].concat.apply(criteria, tieBreakers)));
  return {
    matched: matched,
    unmatched: unmatched,
    sorted: matched.concat(unmatched)
  };
}
function splice(array, criteria, tieBreakers) {
  if (!criteria) { criteria = returnFalse; }
  var matcher = anymatch(criteria);
  var matched = array.filter(matcher);
  var unmatched = array.filter(function(s) {
    return matched.indexOf(s) === -1;
  }).sort();
  if (!Array.isArray(criteria)) { criteria = [criteria]; }
  // use [].concat.apply because criteria may or may not be an array
  matched = matched.sort(anysort([].concat.apply(criteria, tieBreakers)));
  return {
    matched: matched,
    unmatched: unmatched,
    sorted: matched.concat(unmatched)
  };
}
function splice ( array , criteria , tieBreakers ) { if ( ! criteria ) { criteria = returnFalse ; } var matcher = anymatch ( criteria ) ; var matched = array . filter ( matcher ) ; var unmatched = array . filter ( function ( s ) { return matched . indexOf ( s ) === - 1 ; } ) . sort ( ) ; if ( ! Array . isArray ( criteria ) ) { criteria = [ criteria ] ; } // use [].concat.apply because criteria may or may not be an array matched = matched . sort ( anysort ( [ ] . concat . apply ( criteria , tieBreakers ) ) ) ; return { matched : matched , unmatched : unmatched , sorted : matched . concat ( unmatched ) } ; }
given the sorting criteria and full array, returns the fully sorted array as well as separate matched and unmatched lists
given the sorting criteria and full array returns the fully sorted array as well as separate matched and unmatched lists