MCPcopy
hub / github.com/resume/resume.github.com / sortLanguages

Function sortLanguages

js/githubresume.js:344–369  ·  view source on GitHub ↗
(languages, limit)

Source from the content-addressed store, hash-verified

342
343 var languageTotal = 0;
344 function sortLanguages(languages, limit) {
345 var sorted_languages = [];
346
347 for (var lang in languages) {
348 if (typeof(lang) !== "string") {
349 continue;
350 }
351 sorted_languages.push({
352 name: lang,
353 popularity: languages[lang],
354 toString: function() {
355 return '<a href="https://github.com/search?q=user%3A'
356 + username + '&l=' + encodeURIComponent(this.name) + '">'
357 + this.name + '</a>';
358 }
359 });
360
361 languageTotal += languages[lang];
362 }
363
364 if (limit) {
365 sorted_languages = sorted_languages.slice(0, limit);
366 }
367
368 return sorted_languages.sort(sortByPopularity);
369 }
370
371 $.ajax({
372 url: 'views/job.html',

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected