code: function(param_, test) {
    var param = param_.replace(/\s+/g, '')
      , cap;
  
    if (param === 'even') {
      param = '2n+0';
    } else if (param === 'odd') {
      param = '2n+1';
    } else if (param.indexOf('n') === -1) {
      param = '0n' + param;
    }
  
    cap = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param);
  
    return {
      group: cap[1] === '-'
        ? -(cap[2] || 1)
        : +(cap[2] || 1),
      offset: cap[4]
        ? (cap[3] === '-' ? -cap[4] : +cap[4])
        : 0
    };
  }
docs: Handle `nth` Selectors