feature(package) kebabToCamelCase -> just-pascal-case

This commit is contained in:
coderaiser 2018-12-05 14:06:34 +02:00
parent e6dee77695
commit a86edf1497
5 changed files with 7 additions and 51 deletions

View file

@ -2,9 +2,6 @@
const exec = require('execon');
module.exports.getStrBigFirst = getStrBigFirst;
module.exports.kebabToCamelCase = kebabToCamelCase;
module.exports.escapeRegExp = (str) => {
const isStr = typeof str === 'string';
@ -106,23 +103,3 @@ module.exports.timeEnd = (name) => {
exec.ifExist(console, 'timeEnd', [name]);
};
function getStrBigFirst(str) {
if (!str)
throw Error('str could not be empty!');
const first = str[0].toUpperCase();
return first + str.slice(1);
}
function kebabToCamelCase(str) {
if (!str)
throw Error('str could not be empty!');
return str
.split('-')
.map(getStrBigFirst)
.join('')
.replace(/.js$/, '');
}