Update utils.js

This commit is contained in:
Aleksandr Statciuk 2021-07-06 22:32:08 +03:00
parent ebc7a6d5d8
commit 97c92b4e87
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ const zlib = require('zlib')
const urlParser = require('url')
const escapeStringRegexp = require('escape-string-regexp')
const markdownInclude = require('markdown-include')
const iso6393 = require('iso-639-3')
const iso6393 = require('@freearhey/iso-639-3')
const transliteration = require('transliteration')
const regions = require('./regions')
const categories = require('./categories')
@ -58,7 +58,7 @@ utils.code2name = function (code) {
utils.language2code = function (name) {
const lang = iso6393.find(l => l.name === name)
return lang && lang.iso6393 ? lang.iso6393 : null
return lang && lang.code ? lang.code : null
}
utils.sortBy = function (arr, fields) {