endpoints/endpoints

View on GitHub
src/application/lib/parse_options.js

Summary

Maintainability
A
1 hr
Test Coverage
export default function (opts={}) {
  if (!opts.routeBuilder) {
    throw new Error('No route builder specified.');
  }
  if (!opts.searchPaths) {
    opts.searchPaths = [];
  } else if (!Array.isArray(opts.searchPaths)) {
    opts.searchPaths = [opts.searchPaths];
  }
  return opts;
}