mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 23:43:45 +02:00
refact: favour functional approach
This commit is contained in:
@@ -10,12 +10,10 @@ interface IResourceBreadcrumbProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function capitalize(str: string): string {
|
function capitalize(str: string): string {
|
||||||
const split = str.split(" ")
|
return str
|
||||||
const reconstruct = []
|
.split(" ")
|
||||||
for (const substr of split) {
|
.map(word => `${word.charAt(0).toUpperCase()}${word.substring(1)}`)
|
||||||
reconstruct.push(`${substr.charAt(0).toUpperCase()}${substr.substring(1)}`)
|
.join(" ")
|
||||||
}
|
|
||||||
return reconstruct.join(" ")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Link({ item }: { item: IFileOrFolder }) {
|
function Link({ item }: { item: IFileOrFolder }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user