text: 'use strict'
  
  const { isValidMultiaddr } = require('./utils')
  const { withTimeoutOption } = require('../../utils')
  
  module.exports = ({ repo }) => {
    return withTimeoutOption(async function rm (multiaddr, options = {}) {
      if (!isValidMultiaddr(multiaddr)) {
        throw new Error(`${multiaddr} is not a valid Multiaddr`)
      }
  
      const config = await repo.config.getAll(options)
      config.Bootstrap = (config.Bootstrap || []).filter(ma => ma !== multiaddr)
  
      await repo.config.set(config)
  
      return { Peers: [multiaddr] }
    })
  }
  