Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
santoshdasa12345 committed Jan 7, 2025
1 parent e139e10 commit bf34dc9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/client/modules/Investments/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import urls from '../../../lib/urls'

const transformToSentenceCase = (text) => {
let result = text.replace(/_/g, ' ')
return result.charAt(0).toUpperCase() + result.slice(1).toLowerCase().replace(/uk/g, 'UK')
return (
result.charAt(0).toUpperCase() +
result.slice(1).toLowerCase().replace(/uk/g, 'UK')
)
}

export const buildProjectBreadcrumbs = (pageBreadcrumbs) => {
Expand Down Expand Up @@ -36,16 +39,15 @@ export const buildEYBLeadBreadcrumbs = (pageBreadcrumbs) => {
}

export const camelCaseToSentenceCase = (text) => {

if (typeof text === "string") {
if (typeof text === 'string') {
return transformToSentenceCase(text)
} else if (Array.isArray(text)) {
return text.map(item => {
if (typeof item === "string") {
return text.map((item) => {
if (typeof item === 'string') {
return transformToSentenceCase(item)
} else {
return item
}
})
}
}
}

0 comments on commit bf34dc9

Please sign in to comment.