function getSemverRange(x) {
  const s = String(x)
  let ret = cache.get(s) || null

  if (!ret) {
    try {
      ret = new semver.Range(s)
    } catch (_error) {
      // Ignore parsing error.
    }
    cache.set(s, ret)
  }

  return ret
}
Get the `semver.Range` object of a given range text.
@param {string} x The text expression for a semver range.
@returns {semver.Range} The range object of a given range text.
It's null if the `x` is not a valid range text.