getDoclets = str => {
  const doclets = []
  let match = DOCLET_PATTERN.exec(str)
  let val

  for (; match; match = DOCLET_PATTERN.exec(str)) {
    val = match[2] ? match[2].replace(/\r$/, ``) : true
    const key = match[1]
    doclets.push({ tag: key, value: val })
  }
  return doclets
}
Given a string, this function returns an object with doclet names as keys
and their "content" as values.

Adapted from https://github.com/reactjs/react-docgen/blob/ee8a5359c478b33a6954f4546637312764798d6b/src/utils/docblock.js#L62
Updated to strip \r from the end of doclets