Skip to content

Commit

Permalink
remove lodash, use direct js, closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
prograhammer committed Aug 30, 2017
1 parent 963866d commit 2672f88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions meta.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var _ = require('lodash/string')

module.exports = {
"helpers": {
"if_or": function (v1, v2, options) {
Expand All @@ -9,7 +7,12 @@ module.exports = {

return options.inverse(this);
},
"camelcase": str => _.camelCase(str)
"camelcase": str => {
const capitalize = str => str.charAt(0).toUpperCase() + str.toLowerCase().slice(1)
let string = str.toLowerCase().replace(/[^A-Za-z0-9]/g, ' ').split(' ')
.reduce((result, word) => result + capitalize(word.toLowerCase()))
return string.charAt(0).toLowerCase() + string.slice(1)
}
},
"prompts": {
"name": {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"docs:deploy": "bash ./deploy-docs.sh"
},
"devDependencies": {
"lodash": "^4.17.4",
"vue-cli": "^2.8.1"
}
}

0 comments on commit 2672f88

Please sign in to comment.