lib/swagger-koa/index.js
function readApi(file, fn) {
  var ext = path.extname(file);
  if ('.js' === ext || '.ts' === ext) {
    readJsDoc(file, fn);
  } else if ('.yml' === ext) {
    readYml(file, fn);
  } else if ('.coffee' === ext) {
    readCoffee(file, fn);
  } else {
    throw new Error('Unsupported extension \'' + ext + '\'');
  }
}
function readApi(file, fn) {
  var ext = path.extname(file);
  if ('.js' === ext || '.ts' === ext) {
    readJsDoc(file, fn);
  } else if ('.yml' === ext) {
    readYml(file, fn);
  } else if ('.coffee' === ext) {
    readCoffee(file, fn);
  } else {
    throw new Error('Unsupported extension \'' + ext + '\'');
  }
}
function readApi ( file , fn ) { var ext = path . extname ( file ) ; if ( '.js' === ext || '.ts' === ext ) { readJsDoc ( file , fn ) ; } else if ( '.yml' === ext ) { readYml ( file , fn ) ; } else if ( '.coffee' === ext ) { readCoffee ( file , fn ) ; } else { throw new Error ( 'Unsupported extension \'' + ext + '\'' ) ; } }
Read API from file
@api    private
@param  {String}   file
@param  {Function} fn
Read API from file