index.js
function type(filename, opts) {
  opts = opts || {};
  if (opts.parse && typeof opts.parse === 'string') {
    return opts.parse;
  }
  var ext = path.extname(filename);
  return ext || 'json';
}
function type(filename, opts) {
  opts = opts || {};
  if (opts.parse && typeof opts.parse === 'string') {
    return opts.parse;
  }
  var ext = path.extname(filename);
  return ext || 'json';
}
function type ( filename , opts ) { opts = opts || { } ; if ( opts . parse && typeof opts . parse === 'string' ) { return opts . parse ; } var ext = path . extname ( filename ) ; return ext || 'json' ; }
Detect the type to parse, JSON or YAML. Sometimes this is based on file extension,
other times it must be specified on the options.

@param  {String} `filename`
@param  {Object} `opts` If `filename` does not have an extension, specify the type on the `parse` option.
@return {String} The type to parse.
Detect the type to parse JSON or YAML . Sometimes this is based on file extension other times it must be specified on the options .