chore: reorganize docs apps (#7228)

* reorganize docs apps

* add README

* fix directory

* add condition for old docs
This commit is contained in:
Shahed Nasser
2024-05-03 17:36:38 +03:00
committed by GitHub
parent 224ebb2154
commit 4fe28f5a95
6187 changed files with 601447 additions and 598226 deletions

View File

@@ -1,4 +1,5 @@
export * from "./get-type-children"
export * from "./get-project-child"
export * from "./get-type-str"
export * from "./str-formatting"
export * from "./str-utils"

View File

@@ -0,0 +1,77 @@
export function kebabToSnake(str: string): string {
return str.replaceAll("-", "_")
}
export function capitalize(str: string): string {
return `${str.charAt(0).toUpperCase()}${str.substring(1).toLowerCase()}`
}
export function wordsToCamel(str: string): string {
return `${str.charAt(0).toLowerCase()}${str
.substring(1)
.replaceAll(/\s([a-zA-Z])/g, (captured) => captured.toUpperCase())}`
}
export function camelToWords(str: string): string {
return str
.replaceAll(/([A-Z])/g, " $1")
.trim()
.toLowerCase()
}
export function camelToTitle(str: string): string {
return str
.replaceAll(/([A-Z])/g, " $1")
.split(" ")
.map((word) => capitalize(word))
.join(" ")
.trim()
}
export function snakeToWords(str: string): string {
return str.replaceAll("_", " ").toLowerCase()
}
export function kebabToTitle(str: string): string {
return str
.split("-")
.map((word) => capitalize(word))
.join(" ")
}
export function kebabToCamel(str: string): string {
return str
.split("-")
.map((word, index) => {
if (index === 0) {
return word
}
return `${word.charAt(0).toUpperCase()}${word.substring(1)}`
})
.join("")
}
export function kebabToPascal(str: string): string {
return str
.split("-")
.map((word) => capitalize(word))
.join("")
}
export function wordsToKebab(str: string): string {
return str
.split(" ")
.map((word) => word.toLowerCase())
.join("-")
}
export function wordsToPascal(str: string): string {
return str
.split(" ")
.map((word) => capitalize(word))
.join("")
}
export function pascalToCamel(str: string): string {
return `${str.charAt(0).toLowerCase()}${str.substring(1)}`
}