<commit_before>###
Check whether update is available
###

# GitHub API URI
api = ->
  "#{PACKAGE.homepage
  .replace /// // ///, '$&api.'
  .replace /// \w/ ///, '$&repos/'
  }/tags?per_page=8"

# Return available tags
tags = ->
  for tag in json2 ajax api()
    tag.name<commit_msg>Find latest tag<commit_after>###
Check whether update is available
###

# GitHub API URI
api = ->
  "#{PACKAGE.homepage
  .replace /// // ///, '$&api.'
  .replace /// \w/ ///, '$&repos/'
  }/tags?per_page=8"

# Return available tags
tags = ->
  for tag in json2 ajax api() by -1
    tag.name

filter = (str)->
  n = for n in str.split /\D+/ when n.length
    Number n
  new vfilter.ctr n

gt = (left, right)->
  0 < semver.cmpi left, right

latest = ->
  me = filter PACKAGE.version
  max = 0
  for tag in tags() by -1
    tag = filter tag
    continue unless gt tag, me
    if !max or gt tag, max
      max = tag
  max.$[0].join '.' if max
{'fraction_non_alphanumeric': 0.17659804983748645, 'fraction_numerical': 0.009750812567713976, 'mean_word_length': 2.2535211267605635, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2986065', 'n_tokens_mistral': 343, 'n_tokens_neox': 334, 'n_words': 112}