gristlabs / ts-interface-checker

Runtime library to validate data against TypeScript interfaces.
Apache License 2.0
323 stars 18 forks source link

Feature request: Deno support #70

Open acomagu opened 1 year ago

acomagu commented 1 year ago

Currently it works with following configuration in deno.json

{
  "imports": {
    "ts-interface-checker": "npm:ts-interface-checker"
  }
}

But ideally, it should work without special settings.

It's possible to add --deno flag to adapt generated code to Deno syntax?

Thank you!

dsagal commented 1 year ago

Do you mean that ts-interface-builder should have this flag? It already has a --format flag, to output ts or js:esm or js:cjs code (differing mainly in import and export syntax). Perhaps adding deno as another supported format would be a good approach? A pull request would be welcome. If import syntax is the main difference compared to an existing format, then I imagine that this area of the code is a good place to start: https://github.com/gristlabs/ts-interface-builder/blob/8ff1a0c9f4b59d5b5038f366fb485f344ae70813/lib/index.ts#L248