Skip to content

Commit 4b33e49

Browse files
committed
Add lib/langs.js
1 parent 325ed81 commit 4b33e49

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/langs.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var MAP = {
2+
'py': 'python',
3+
'js': 'javascript',
4+
'rb': 'ruby',
5+
'csharp': 'cs',
6+
};
7+
8+
function normalize(lang) {
9+
if(!lang) { return null; }
10+
11+
var lower = lang.toLowerCase();
12+
return MAP[lower] || lower;
13+
}
14+
15+
// Exports
16+
module.exports = {
17+
normalize: normalize,
18+
MAP: MAP
19+
};

0 commit comments

Comments
 (0)