acronym.js

1
2
3
4
5
6
7
8
9
10
var abbrevMatch = /(?:\b(\w)|([A-Z])[a-z]+)/g;

var Acronyms = {
  parse: function(text) {
    var matches = text.match(abbrevMatch);
    return matches.map(function(m) { return m[0].toUpperCase(); }).join("");
  }
};

module.exports = Acronyms;

Comments


You're not logged in right now. Please login via GitHub to comment