Skip to content

Commit

Permalink
fix(bindgen): Fix empty options detection
Browse files Browse the repository at this point in the history
Addresses:

```
src/mesh-to-poly-data-node.ts:24:3 - error TS6133: 'options' is declared but its value is never read.

24   options: MeshToPolyDataOptions = {}
     ~~~~~~~
```
  • Loading branch information
thewtex committed Feb 12, 2023
1 parent 4dd76d1 commit 0ca37a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bindgen/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ function typescriptBindings(outputDir, buildDir, wasmBinaries, options, forNode=
indexContent += `\n\nimport ${modulePascalCase}${nodeTextCamel}Result from './${moduleKebabCase}${nodeTextKebab}-result.js'\n`
indexContent += `export type { ${modulePascalCase}${nodeTextCamel}Result }\n\n`

// -----------------------------------------------------------------
// Options module
const haveParameters = !!interfaceJson.parameters.length
const filteredParameters = interfaceJson.parameters.filter(p => { return p.name !== 'memory-io'})
const haveParameters = !!filteredParameters.length
if (haveParameters) {
readmeOptions += `\n**\`${modulePascalCase}${nodeTextCamel}Options\` interface:**\n\n`
const readmeOptionsTable = [ ['Property', 'Type', 'Description'], ]
Expand Down Expand Up @@ -283,6 +285,7 @@ function typescriptBindings(outputDir, buildDir, wasmBinaries, options, forNode=
readmeOptions += markdownTable(readmeOptionsTable, { align: ['c', 'c', 'l'] }) + '\n'
}

// -----------------------------------------------------------------
// function module
let functionContent = 'import {\n'
const usedInterfaceTypes = new Set()
Expand Down

0 comments on commit 0ca37a3

Please sign in to comment.