function parseStringDirective_(filterElement) {
    var match = RegExp('^([^:]*):(.*)$').exec(filterElement);
    if (!match)
      return null;

    // Split parameters around commas and remove empty elements.
    var parameters = match[2].split(',');
    parameters = parameters.filter(function(string) {
      return string.length > 0;
    });

    if (match[1] == 'type') {
      return function(sourceEntry) {
        var i;
        var sourceType = sourceEntry.getSourceTypeString().toLowerCase();
        for (i = 0; i < parameters.length; ++i) {
          if (sourceType.search(parameters[i]) != -1)
            return true;
        }
        return false;
      };
    }

    if (match[1] == 'id') {
      return function(sourceEntry) {
        return parameters.indexOf(sourceEntry.getSourceId() + '') != -1;
      };
    }

    return null;
  }
/**
   * Tries to parse |filterElement| as a single filter of a type that takes
   * arbitrary strings as input, and returns a new filter function on success.
   * Returns null on failure.
   */
Tries to parse |filterElement| as a single filter of a type that takes
arbitrary strings as input, and returns a new filter function on success.
Returns null on failure.
Tries to parse |filterElement| as a single filter of a type that takes arbitrary strings as input and returns a new filter function on success . Returns null on failure .
function parseStringDirective_(filterElement) {
    var match = RegExp('^([^:]*):(.*)$').exec(filterElement);
    if (!match)
      return null;
    var parameters = match[2].split(',');
    parameters = parameters.filter(function(string) {
      return string.length > 0;
    });
    if (match[1] == 'type') {
      return function(sourceEntry) {
        var i;
        var sourceType = sourceEntry.getSourceTypeString().toLowerCase();
        for (i = 0; i < parameters.length; ++i) {
          if (sourceType.search(parameters[i]) != -1)
            return true;
        }
        return false;
      };
    }
    if (match[1] == 'id') {
      return function(sourceEntry) {
        return parameters.indexOf(sourceEntry.getSourceId() + '') != -1;
      };
    }
    return null;
  }
function parseStringDirective_ ( filterElement ) { var match = RegExp ( '^([^:]*):(.*)$' ) . exec ( filterElement ) ; if ( ! match ) return null ; var parameters = match [ 2 ] . split ( ',' ) ; parameters = parameters . filter ( function ( string ) { return string . length > 0 ; } ) ; if ( match [ 1 ] == 'type' ) { return function ( sourceEntry ) { var i ; var sourceType = sourceEntry . getSourceTypeString ( ) . toLowerCase ( ) ; for ( i = 0 ; i < parameters . length ; ++ i ) { if ( sourceType . search ( parameters [ i ] ) != - 1 ) return true ; } return false ; } ; } if ( match [ 1 ] == 'id' ) { return function ( sourceEntry ) { return parameters . indexOf ( sourceEntry . getSourceId ( ) + '' ) != - 1 ; } ; } return null ; }
Tries to parse |filterElement| as a single filter of a type that takes
 arbitrary strings as input, and returns a new filter function on success.
Tries to parse |filterElement| as a single filter of a type that takes arbitrary strings as input and returns a new filter function on success .
// Split parameters around commas and remove empty elements.