summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/index.js3
-rw-r--r--lib/utils/lang.js16
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/utils/index.js b/lib/utils/index.js
new file mode 100644
index 0000000..155e723
--- /dev/null
+++ b/lib/utils/index.js
@@ -0,0 +1,3 @@
+module.exports = {
+ lang: require('./lang'),
+};
diff --git a/lib/utils/lang.js b/lib/utils/lang.js
new file mode 100644
index 0000000..7fd71e1
--- /dev/null
+++ b/lib/utils/lang.js
@@ -0,0 +1,16 @@
+var MAP = {
+ 'py': 'python',
+ 'js': 'javascript',
+ 'rb': 'ruby',
+};
+
+function normalize(lang) {
+ var lower = lang.toLowerCase();
+ return MAP[lower] || lower;
+}
+
+// Exports
+module.exports = {
+ normalize: normalize,
+ MAP: MAP
+};