code: function granularity(granularity) {
    if (utils.isObject(granularity)) {
      return granularity
    }
    else if (typeof granularity === 'string' && ~GRANULARITIES.indexOf(granularity)) {
      return granularity
    }
  
    if (!formatters.hasOwnProperty(granularity)) {
      throw new FieldError('Bad granularity type: ' + granularity)
    }
  
    var args = utils.args(arguments, 1)
      , spec = {
        type: granularity
      }
  
    formatters[granularity].apply(spec, args)
  
    return spec
  }
docs: Set granularity
  
  @param {string|object} granularity Granularity as string or type
  @param {...*} args Arguments depending on granularity type
  @returns {string|object}