plugins/sigma.plugins.filter/sigma.plugins.filter.js
function register(fn, p, key) {
    if (key != undefined && typeof key !== 'string')
      throw 'The filter key "'+ key.toString() +'" must be a string.';

    if (key != undefined && !key.length)
      throw 'The filter key must be a non-empty string.';

    if (typeof fn !== 'function')
      throw 'The predicate of key "'+ key +'" must be a function.';

    if ('undo' === key)
      throw '"undo" is a reserved key.';

    if (_keysIndex[key])
      throw 'The filter "' + key + '" already exists.';

    if (key)
      _keysIndex[key] = true;

    _chain.push({
      'key': key,
      'processor': fn,
      'predicate': p
    });
  }
function register(fn, p, key) {
    if (key != undefined && typeof key !== 'string')
      throw 'The filter key "'+ key.toString() +'" must be a string.';

    if (key != undefined && !key.length)
      throw 'The filter key must be a non-empty string.';

    if (typeof fn !== 'function')
      throw 'The predicate of key "'+ key +'" must be a function.';

    if ('undo' === key)
      throw '"undo" is a reserved key.';

    if (_keysIndex[key])
      throw 'The filter "' + key + '" already exists.';

    if (key)
      _keysIndex[key] = true;

    _chain.push({
      'key': key,
      'processor': fn,
      'predicate': p
    });
  }
function register ( fn , p , key ) { if ( key != undefined && typeof key !== 'string' ) throw 'The filter key "' + key . toString ( ) + '" must be a string.' ; if ( key != undefined && ! key . length ) throw 'The filter key must be a non-empty string.' ; if ( typeof fn !== 'function' ) throw 'The predicate of key "' + key + '" must be a function.' ; if ( 'undo' === key ) throw '"undo" is a reserved key.' ; if ( _keysIndex [ key ] ) throw 'The filter "' + key + '" already exists.' ; if ( key ) _keysIndex [ key ] = true ; _chain . push ( { 'key' : key , 'processor' : fn , 'predicate' : p } ) ; }
This function adds a filter to the chain of filters.

@param  {function} fn  The filter (i.e. predicate processor).
@param  {function} p   The predicate.
@param  {?string}  key The key to identify the filter.
This function adds a filter to the chain of filters .