diff --git a/packages/types/scripts/extract-integrity-enums.ts b/packages/types/scripts/extract-integrity-enums.ts index 6a41c8e..df21ccf 100644 --- a/packages/types/scripts/extract-integrity-enums.ts +++ b/packages/types/scripts/extract-integrity-enums.ts @@ -38,10 +38,10 @@ async function main() { fs.writeFile("./src/integrity-enums/index.ts", indexContent); } -async function getZomeIndices() { +async function getZomeIndices(): Promise { 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) ); } @@ -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); }; diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index 5470e60..081b0d0 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,4 +1,9 @@ { "extends": "../../tsconfig.json", - "include": ["src", "rollup.node.config.ts", "rollup.browser.config.ts"] -} \ No newline at end of file + "include": [ + "src", + "rollup.node.config.ts", + "rollup.browser.config.ts", + "scripts/*" + ] +}