UNPKG

wikidata-lang

Version:

A database of languages and their Wikidata id, Wikimedia language code, ISO 639-1, ISO 639-2, ISO 639-3, ISO 639-6 codes

9 lines (8 loc) 210 B
export function sortObjectByKey (obj) { return Object.entries(obj) .sort((a, b) => a[0] > b[0] ? 1 : -1) .reduce((sortedObj, entry) => { sortedObj[entry[0]] = entry[1] return sortedObj }, {}) }