I

I made TypeScript's type inference more strict (and smarter)

Hacker News

I made TypeScript's type inference more strict (and smarter)

As a TypeScript developer, I often found myself wishing the type system could do more—*especially when omitting or modifying deeply nested properties* inside complex objects and arrays. For instance, what if I want to remove a deeply nested field like `user.profile.email` and also something like `user.posts[ ].meta.shares` from a type? TypeScript doesn't really provide a built-in way to do that. So I built *DeepStrictTypes* — a utility that lets you *omit deeply nested keys*, even inside arrays, with full type inference and strictness. Here’s an example: ```ts type Example = { user: { id: string; profile: { name: string; age: number; email: string; }; posts: { title: string; content: string; meta: { likes: number; shares: number; }; }[]; }; }; // Remove 'user.profile.email' and 'user.posts[ ].meta.shares' type Omitted = DeepStrictOmit< Example, 'user.profile.email' | 'user.posts[*].meta.shares' >; ``` The resulting type: ```ts { user: { id: string; profile: { name: string; age: number; }; posts: { title: string; content: string; meta: { likes: number; }; }[]; }; } ``` Works great for: - Cleaning up types for API responses - Dynamically transforming deeply nested data - Improving type safety when handling structured JSON [ https://github.com/kakasoo/deepstricttypes ]( https://github.com/kakasoo/deepstricttypes ) Would love your feedback or ideas for improvements!

Share card

Actual performance

3points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: user, email · Missing: mac, agents, macos
77%77% 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 · Missing: supports, reddit linkedin, podcasting
65%65% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
43%43% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: ide · Missing: https docs, excited, just released
40%40% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
36%36% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
18%18% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Strong signals: smart · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Ty
TypeScript to GraphQL conversion tool with type inference60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

TypeScript to GraphQL conversion tool with type inference

Hacker News90
Ty
TypeScript query builder with full type inference58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

TypeScript query builder with full type inference

Hacker News4
Fa
Fastify-zod, type-once, run everywhere (TypeScript/OpenAPI)55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fastify-zod, type-once, run everywhere (TypeScript/OpenAPI)

Hacker News7
ty
type-kanren – type-level microKanren in TypeScript45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

type-kanren – type-level microKanren in TypeScript

Hacker News5
Ty
Type-level Lambda Calculus interpreter in TypeScript55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Type-level Lambda Calculus interpreter in TypeScript

Hacker News10
Co
Compile Python libraries for TypeScript with type completion (umo)61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Compile Python libraries for TypeScript with type completion (umo)

Hacker News1
Co
Conway's Game of Life in TypeScript's type system50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Conway's Game of Life in TypeScript's type system

Hacker News186
Ty
TypeScript Hack – Type System Adventure47%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

TypeScript Hack – Type System Adventure

Hacker News2
No
Nola – a TypeScript superset where LLM inference is a language feature57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Nola – a TypeScript superset where LLM inference is a language feature

Hacker News3
La
Lambda Calculus evaluation with type-annotations in TypeScript55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lambda Calculus evaluation with type-annotations in TypeScript

Hacker News2