Skip to content

Commit

Permalink
Solved some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaumesegarra committed Apr 24, 2019
1 parent 0acdb2e commit 0343daa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ const resourcePatronize = (resource, stuffName, delimiter, vars) => {
};

String.prototype.replaceFunctionPattern = function (pattern, functionName) {
return this.replace(delimitate(pattern+'\\(.*\\)', delimiter), w => w[functionName]().replace(delimitate(pattern+'\\((.*)\\)', delimiter), '$1')[functionName]())
return this.replace(delimitate(pattern+'\\(.*\\)', delimiter), w => w.replace(delimitate(pattern+'\\((.*)\\)', delimiter), '$1')[functionName]())
}

res = res
.replaceFunctionPattern('cc', 'toCamelCase')
.replaceFunctionPattern('sc', 'toSnakeCase')
.replaceFunctionPattern('kc', 'toKebabCase')
.replaceFunctionPattern('uc', 'toUpperCase')
.replaceFunctionPattern('lc', 'toLowerCase')
.replaceFunctionPattern('cz', 'toCapitalize')
.replaceFunctionPattern('ls', 'toLowerStart')
.replaceFunctionPattern('cc', 'toCamelCase')
.replaceFunctionPattern('sc', 'toSnakeCase')
.replaceFunctionPattern('kc', 'toKebabCase');
.replaceFunctionPattern('ls', 'toLowerStart');

return res;
};
Expand Down

0 comments on commit 0343daa

Please sign in to comment.