class Importmap::Npm

def find_latest_version(response)

def find_latest_version(response)
  latest_version = response.dig('dist-tags', 'latest')
  return latest_version if latest_version
  return unless response['versions']
  response['versions'].keys.map { |v| Gem::Version.new(v) rescue nil }.compact.sort.last
end