Skip to content

Commit

Permalink
Merge pull request #146 from eve-cxrp/master
Browse files Browse the repository at this point in the history
attempt to fix github issue #135
  • Loading branch information
tecimovic committed May 13, 2021
2 parents f035d8d + 9a27e33 commit 535ebf3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src-electron/util/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* @parem {*} firstLower if True the it starts with lowecase.
* @returns a spaced out string in lowercase
*/
function toCamelCase(label, firstLower = true) {
let str = label.split(/ |_|-|\//)
function toCamelCase(label, firstLower = true) {
let str = label.replace(/[+()&]/g, '').split(/ |_|-|\//)
let res = ''
for (let i = 0; i < str.length; i++) {
if (i == 0 && firstLower) {
Expand All @@ -46,7 +46,7 @@ function toCamelCase(label, firstLower = true) {
}

function toSpacedLowercase(str) {
let res = str.replace(/\.?([A-Z][a-z])/g, function (x, y) {
let res = str.replace(/[+()&]/g, '').replace(/\.?([A-Z][a-z])/g, function (x, y) {
return ' ' + y
})
return res.toLowerCase()
Expand All @@ -61,7 +61,7 @@ function toSpacedLowercase(str) {
function toSnakeCaseAllCaps(label) {
let ret = ''
if (label == null) return ret
label = label.replace(/\.?([A-Z][a-z])/g, function (x, y) {
label = label.replace(/[+()&]/g, '').replace(/\.?([A-Z][a-z])/g, function (x, y) {
return '_' + y
})
let wasUp = false
Expand Down

0 comments on commit 535ebf3

Please sign in to comment.