lib/utils.js
function() {
    var list = [];

    // Append argument(s) to the list
    var argfunc = function() {
      if (arguments.length === 1 && Array.isArray(arguments[0])) {
        list = list.concat(arguments[0]);
      } else {
        list = list.concat([].slice.call(arguments));
      }
    };

    // Clear argument list
    argfunc.clear = function() {
      list = [];
    };

    // Return argument list
    argfunc.get = function() {
      return list;
    };

    // Find argument 'arg' in list, and if found, return an array of the 'count' items that follow it
    argfunc.find = function(arg, count) {
      var index = list.indexOf(arg);
      if (index !== -1) {
        return list.slice(index + 1, index + 1 + (count || 0));
      }
    };

    // Find argument 'arg' in list, and if found, remove it as well as the 'count' items that follow it
    argfunc.remove = function(arg, count) {
      var index = list.indexOf(arg);
      if (index !== -1) {
        list.splice(index, (count || 0) + 1);
      }
    };

    // Clone argument list
    argfunc.clone = function() {
      var cloned = utils.args();
      cloned(list);
      return cloned;
    };

    return argfunc;
  }
function() {
    var list = [];

    // Append argument(s) to the list
    var argfunc = function() {
      if (arguments.length === 1 && Array.isArray(arguments[0])) {
        list = list.concat(arguments[0]);
      } else {
        list = list.concat([].slice.call(arguments));
      }
    };

    // Clear argument list
    argfunc.clear = function() {
      list = [];
    };

    // Return argument list
    argfunc.get = function() {
      return list;
    };

    // Find argument 'arg' in list, and if found, return an array of the 'count' items that follow it
    argfunc.find = function(arg, count) {
      var index = list.indexOf(arg);
      if (index !== -1) {
        return list.slice(index + 1, index + 1 + (count || 0));
      }
    };

    // Find argument 'arg' in list, and if found, remove it as well as the 'count' items that follow it
    argfunc.remove = function(arg, count) {
      var index = list.indexOf(arg);
      if (index !== -1) {
        list.splice(index, (count || 0) + 1);
      }
    };

    // Clone argument list
    argfunc.clone = function() {
      var cloned = utils.args();
      cloned(list);
      return cloned;
    };

    return argfunc;
  }
function ( ) { var list = [ ] ; // Append argument(s) to the list var argfunc = function ( ) { if ( arguments . length === 1 && Array . isArray ( arguments [ 0 ] ) ) { list = list . concat ( arguments [ 0 ] ) ; } else { list = list . concat ( [ ] . slice . call ( arguments ) ) ; } } ; // Clear argument list argfunc . clear = function ( ) { list = [ ] ; } ; // Return argument list argfunc . get = function ( ) { return list ; } ; // Find argument 'arg' in list, and if found, return an array of the 'count' items that follow it argfunc . find = function ( arg , count ) { var index = list . indexOf ( arg ) ; if ( index !== - 1 ) { return list . slice ( index + 1 , index + 1 + ( count || 0 ) ) ; } } ; // Find argument 'arg' in list, and if found, remove it as well as the 'count' items that follow it argfunc . remove = function ( arg , count ) { var index = list . indexOf ( arg ) ; if ( index !== - 1 ) { list . splice ( index , ( count || 0 ) + 1 ) ; } } ; // Clone argument list argfunc . clone = function ( ) { var cloned = utils . args ( ) ; cloned ( list ) ; return cloned ; } ; return argfunc ; }
Create an argument list

Returns a function that adds new arguments to the list.
It also has the following methods:
- clear() empties the argument list
- get() returns the argument list
- find(arg, count) finds 'arg' in the list and return the following 'count' items, or undefined if not found
- remove(arg, count) remove 'arg' in the list as well as the following 'count' items

@private
Create an argument list