Ge

Gen-ts-type – Code Generate TS Type from JSON data with collapsed field

Hacker News

Gen-ts-type – Code Generate TS Type from JSON data with collapsed field

I built a tool to generate TypeScript types from JSON/JS data, initially to tackle the deeply nested arrays in for a few JSON RPC API (e.g., array[0].content.section.contents[0].item.contents[0] could be a aItem or bItem). Some existing tools generate named union types at every level, which can get messy. This tool automatically converts fields to optional at the right depth, making the types cleaner and easier to use. Features: - Web UI: Paste JSON, get TypeScript types instantly - CLI or importable in TypeScript projects - Handles complex types (nested objects, arrays, etc.) - Supports optional fields and union types where needed Try the Web UI: https://gen-ts-type.surge.sh Also published on github and npm as gen-ts-type Feedback welcome!

Share card

Actual performance

1points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: code · Missing: mac, agents, macos
76%76% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: supports · Missing: reddit linkedin, podcasting, created
68%68% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
47%47% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
34%34% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: exist, existing, io · Missing: https docs, excited, just released
32%32% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
16%16% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
1%1% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Re
ReJSON – a JSON data type for Redis45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

ReJSON – a JSON data type for Redis

Hacker News4
Th
The Tabular Data Type47%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The Tabular Data Type

Hacker News1
GM
GMP Deserialization Type Confusion Vulnerability [MyBB43%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GMP Deserialization Type Confusion Vulnerability [MyBB

Hacker News1
Co
Co-Occurrence of Type in Pokémon45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Co-Occurrence of Type in Pokémon

Hacker News1
Ty
Type someone's name and find out how to pronounce it45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Type someone's name and find out how to pronounce it

Hacker News3
Hi
Hindley–Milner type inferencing in C57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Hindley–Milner type inferencing in C

Hacker News7
Ha
Hash any comparable type in Go55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Hash any comparable type in Go

Hacker News1
I
I simulated Bigtable in BigQuery as a Type 2 SCD40%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I simulated Bigtable in BigQuery as a Type 2 SCD

Hacker News15
Ke
KeyVocab – drill vocab while you type45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

KeyVocab – drill vocab while you type

Hacker News3
a
a type-agnostic wrapper of leveldb for Go26%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

a type-agnostic wrapper of leveldb for Go

Hacker News3