UNPKG

react-native-template-by-nh

Version:

React Native Template for a quick start with TypeScript using best existing libraries and scalable structure

9 lines (7 loc) 239 B
const toCamel = (s: string) => { const p2 = s.replace(/([-_][a-z])/gi, (p1: string) => { return p1.toUpperCase().replace('-', '').replace('_', ''); }); return p2.charAt(0).toUpperCase() + p2.slice(1); }; export default toCamel;