Format module name

This commit is contained in:
Jeroen Engels 2021-03-11 14:00:25 +01:00
parent 75defbee16
commit 9e02a4f120

View File

@ -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) {