garbles / garbles/kitimat

Code generation from TS type aliases

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
68
Forks
1
PR merge metrics
No merged PRs in 30d

Description

TS exposes [custom transformers](https://github.com/Microsoft/TypeScript/issues/13764) through the public API, so it should be possible to create generates purely from a type alias. I've done something like before with [babel as Flow](https://github.com/unbounce/babel-plugin-transform-flow-to-gen).

```ts
import { fromType } from 'kitimat-type-to-gen';

const person = fromType();

// would expand to something like...

const kitimat = require('kitimat-jest');
const person = kitimat.object({
name: kitimat.string(),
age: kitimat.posInt(),
// ... etc
});

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.