UNPKG

286 BJavaScriptView Raw
1const R = require('ramda')
2const semver = require('semver')
3
4// text: output of command "git tag"
5function sortTagsByVersion (text) {
6 const tags = R.reject(R.isEmpty, R.map(R.trim, R.split('\n', R.trim(text))))
7 return tags.sort(semver.compare)
8}
9
10module.exports = sortTagsByVersion