Skip to content

FormidableLabs/ts-simplify

Repository files navigation

ts-simplify

CLI tool to compile TypeScript types into simple, alias-free primitives.

Usage

ts-simplify <source> [output]

This can be run via npx without installation, eg:

npx ts-simplify <source> [output]

Example

If you have a TypeScript file with exported types:

// example-types.ts
type MyType = { a: "A", b: "B", nested: Nested };
type Nested = { c:"C" };
export type MyType = Omit<MyType, 'b'>;

Running this:

ts-simplify ./example-types.ts ./example-types.d.ts

will output this:

// example-types.d.ts
export type MyType = { a: "A", nested: { c: "C" } };

About

CLI tool to compile TypeScript types into simple, alias-free primitives.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published