destructure.js
function generateNamedFieldExtractors(input) {
  var names = input.filter(function(matcher, index, array) {
    // has a name?
    return matcher.name;
  });
  // has duplicates?
  names.forEach(function(matcher, index, array) {
    var isDuplicate = array.slice(0, index).some(function(previousMatcher) {
      return previousMatcher.name == matcher.name;
    });
    if (isDuplicate) {
      throw new Error("duplicate named field '" + matcher.name + "'");
    }
  });
  return names;
}
function generateNamedFieldExtractors(input) {
  var names = input.filter(function(matcher, index, array) {
    // has a name?
    return matcher.name;
  });
  // has duplicates?
  names.forEach(function(matcher, index, array) {
    var isDuplicate = array.slice(0, index).some(function(previousMatcher) {
      return previousMatcher.name == matcher.name;
    });
    if (isDuplicate) {
      throw new Error("duplicate named field '" + matcher.name + "'");
    }
  });
  return names;
}
function generateNamedFieldExtractors ( input ) { var names = input . filter ( function ( matcher , index , array ) { // has a name? return matcher . name ; } ) ; // has duplicates? names . forEach ( function ( matcher , index , array ) { var isDuplicate = array . slice ( 0 , index ) . some ( function ( previousMatcher ) { return previousMatcher . name == matcher . name ; } ) ; if ( isDuplicate ) { throw new Error ( "duplicate named field '" + matcher . name + "'" ) ; } } ) ; return names ; }
this will flatten the input into a list of named field extractors, should be run over output of generateMatchers
this will flatten the input into a list of named field extractors should be run over output of generateMatchers