Skip to content

Commit

Permalink
fix: ts-doc type err
Browse files Browse the repository at this point in the history
  • Loading branch information
8e8b2c committed Sep 6, 2024
1 parent 628801e commit 232c20b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/types/scripts/extract-integrity-enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ async function main() {
fs.writeFile("./src/integrity-enums/index.ts", indexContent);
}

async function getZomeIndices() {
async function getZomeIndices(): Promise<string[]> {
const yamlContent = await fs.readFile("../../workdir/dna.yaml", "utf8");
const dnaManifest = yaml.parse(yamlContent);
return dnaManifest.integrity.zomes.map((zome) =>
return dnaManifest.integrity.zomes.map((zome: { name: string }) =>
snakeToUpperCamel(zome.name)
);
}
Expand Down Expand Up @@ -169,14 +169,14 @@ async function extractEntryEnumsForCrate(name: string) {
return zomeNameUpper;
}

const snakeToCamel = (str) =>
const snakeToCamel = (str: string) =>
str
.toLowerCase()
.replace(/([-_][a-z])/g, (group) =>
group.toUpperCase().replace("-", "").replace("_", "")
);

const snakeToUpperCamel = (str) => {
const snakeToUpperCamel = (str: string) => {
str = snakeToCamel(str);
return str.charAt(0).toUpperCase() + str.slice(1);
};
Expand Down
9 changes: 7 additions & 2 deletions packages/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "rollup.node.config.ts", "rollup.browser.config.ts"]
}
"include": [
"src",
"rollup.node.config.ts",
"rollup.browser.config.ts",
"scripts/*"
]
}

0 comments on commit 232c20b

Please sign in to comment.