code: function bsconfigToOptions(bsconfig) /*: Options */ {
    const bsSuffix = bsconfig.suffix
    const suffix = typeof bsSuffix === 'string' ? bsSuffix : '.js'
  
    if (!bsconfig['package-specs']) {
      const options /*: Options */ = {
        moduleDir: 'js',
        inSource: false,
        suffix,
      }
      return options
    }
  
    const packageSpecs = bsconfig['package-specs']
    const moduleSpec =
      packageSpecs instanceof Array ? packageSpecs[0] : packageSpecs
    const moduleDir /*: BsModuleFormat */ =
      typeof moduleSpec === 'string' ? moduleSpec : moduleSpec.module
    const inSource =
      typeof moduleSpec === 'string' ? false : moduleSpec['in-source']
  
    const options /*: Options */ = {moduleDir, inSource, suffix}
    return options
  }
docs: /*:: type Options = { moduleDir: BsModuleFormat | 'js', inSource: boolean, suffix: string }