diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-04-05 20:04:24 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-04-05 20:04:24 -0700 |
commit | 58bee15f376e5e56477d4e083493d9b6213fbc63 (patch) | |
tree | 5442c344acc9e0d60e103b96f7cc2d34e6a46721 /lib/utils/lang.js | |
parent | 4987beec2ba6d148d1d1e5f356f977a4daab9732 (diff) | |
download | gitbook-58bee15f376e5e56477d4e083493d9b6213fbc63.zip gitbook-58bee15f376e5e56477d4e083493d9b6213fbc63.tar.gz gitbook-58bee15f376e5e56477d4e083493d9b6213fbc63.tar.bz2 |
Add basic code language normalization
Diffstat (limited to 'lib/utils/lang.js')
-rw-r--r-- | lib/utils/lang.js | 16 |
1 files changed, 16 insertions, 0 deletions
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 +}; |