text: 'use strict'
  
  const CID = require('cids')
  const configure = require('../../lib/configure')
  const toUrlSearchParams = require('../../lib/to-url-search-params')
  
  module.exports = configure(api => {
    return async (cid, dLink, options = {}) => {
      const res = await api.post('object/patch/rm-link', {
        timeout: options.timeout,
        signal: options.signal,
        searchParams: toUrlSearchParams({
          arg: [
            `${cid instanceof Uint8Array ? new CID(cid) : cid}`,
            dLink.Name || dLink.name || null
          ],
          ...options
        }),
        headers: options.headers
      })
  
      const { Hash } = await res.json()
  
      return new CID(Hash)
    }
  })
  