/*! * pascalcase <https://github.com/jonschlinkert/pascalcase> * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */functionpascalcase(str){if(typeofstr!=='string'){thrownewTypeError('expected a string.');}str=str.replace(/([A-Z])/g,' $1');if(str.length===1){returnstr.toUpperCase();}str=str.replace(/^[\W_]+|[\W_]+$/g,'').toLowerCase();str=str.charAt(0).toUpperCase()+str.slice(1);returnstr.replace(/[\W_]+(\w|$)/g,function(_,ch){returnch.toUpperCase();});}module.exports=pascalcase;