JSFiddle - React, Tailwind, and code Playground

by nsatija

JavaScript

function PascalCase(string) {
  var str = string.replace(/-([a-z])/ig, function(all, letter) {
    return letter.toUpperCase();
  });
  return str.slice(0, 1).toUpperCase() + str.slice(1);
}

console.log(PascalCase('account-controller'))