mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-12 19:33:45 +03:00
Format module name
This commit is contained in:
parent
75defbee16
commit
9e02a4f120
@ -33,7 +33,11 @@ async function downloadFiles() {
|
||||
}
|
||||
|
||||
function createFile([elmJson, docsJson]) {
|
||||
const moduleName = formatModuleName(packageName);
|
||||
const moduleName = packageName
|
||||
.replace("/", "-")
|
||||
.split("-")
|
||||
.map(capitalize)
|
||||
.join("");
|
||||
|
||||
return `module Dependencies.${moduleName} exposing (dependency)
|
||||
|
||||
@ -85,8 +89,8 @@ decodeType type_ =
|
||||
`
|
||||
}
|
||||
|
||||
function formatModuleName(packageName) {
|
||||
return "ElmParser"
|
||||
function capitalize(str) {
|
||||
return str[0].toUpperCase() + str.slice(1);
|
||||
}
|
||||
|
||||
function formatModule(moduleDoc) {
|
||||
|
Loading…
Reference in New Issue
Block a user