mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature(package) kebabToCamelCase -> just-pascal-case
This commit is contained in:
parent
e6dee77695
commit
a86edf1497
5 changed files with 7 additions and 51 deletions
|
|
@ -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$/, '');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue