Skip to content

Commit

Permalink
Adds sorting og languages (minor)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Sep 27, 2020
1 parent fb9a7a9 commit f7ab643
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ const getTemplate = require('./lib/get-template')
const generateResult = require('./lib/generate-result')
const languages = require('./lib/data/languages.json')

function languageSort (a, b) {
if (a.text < b.text) {
return -1
}
if (a.text > b.text) {
return 1
}
return 0
}

languages.sort(languageSort)

module.exports = data => {
if (!data) {
throw new Error('Missing required input')
Expand Down
18 changes: 0 additions & 18 deletions tst.js

This file was deleted.

0 comments on commit f7ab643

Please sign in to comment.