nyaomaru

nyaomaru

@nyaomaru-dev.bsky.social

Funny frontend engineer (React / Vue / TypeScript) Creator of is-kit ๐Ÿ˜บ https://is-kit.dev/en DSA View View ๐Ÿ‘€๐Ÿ‘€ https://github.com/nyaomaru/dsa-view-view

180 followers755 following240 posts

Pinned

Another thing I noticed comparing TypeScript validators ๐Ÿ˜ธ โ€œExact object validationโ€ sounds simple. But inherited fields, extra symbol keys, sparse arrays, or an extra key with `undefined` can make them disagree. JavaScript is weird. ๐Ÿ˜น Full comparison tomorrow! ๐Ÿฆ

Iโ€™m comparing 7 TypeScript runtime validation approaches for my next article. One thing surprised me: โ€œmax length: 100โ€ didnโ€™t mean the same thing everywhere. ๐Ÿ‘€ For 51 ๐Ÿ˜€: โ€ข 51 Unicode code points โ€ข 102 UTF-16 code units Same-looking rule, different runtime contract. ๐Ÿ˜น

TypeScript 7.1 Beta is interesting ๐Ÿ‘€ What caught me isnโ€™t new type syntax, but the tooling side. `typescript/ast` is getting a proper public API, and Content Mappers make Vue, Svelte, Astro, etc. much easier to integrate. TypeScript 7.x is getting fun. ๐Ÿ˜ธ

changelog-bot v0.10.0 / v0.10.1 are out ๐Ÿš€ v0.10.0: johnnylemonny added sub-change WHY mapping for multi-change PRs. v0.10.1: 5 new contributors joined! ๐ŸŽ‰ KingEmma7 / jay23606 / Prashaxt / mangomac / erSpell Thanks for helping the project grow! ๐Ÿ˜ธ github.com/nyaomaru/changelog-bot/rโ€ฆ

github.comRelease v0.10.1 ยท nyaomaru/changelog-botWe're excited to release changelog-bot v0.10.1! This release brings improvements to runtime type safety, changelog error handling, and test coverage, along with simpler contribution templates.

I've been comparing 7 approaches to runtime validation in TypeScript. ๐Ÿค” Native TS, is-kit, Runtypes, Valibot, Zod, ArkType, typia. Same `User` type. Same validation rules. But making them behave the same was harder than making them compile. ๐Ÿ˜น Full comparison next Wednesday! ๐Ÿฆ

My favorite story from the is-kit 100โญ article: An is-kit refinement using `unknown` exposed an inference edge case in Effect's `catchIf`, which was later fixed with `NoInfer`. ๐Ÿš€ I love bugs that only appear when two libraries meet in real code. ๐Ÿ˜ธ dev.to/nyaomaru/is-kit-reached-100โ€ฆ

dev.tois-kit Reached 100 Stars โญ๐ŸŽ‰ Hereโ€™s What Changed Since 50Hoi hoi! YAY! is-kit just reached 100 GitHub starsโญ ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ When it reached 50 stars, I wrote about how...

YAY! is-kit reached 100 GitHub stars โญ๐ŸŽ‰๐ŸŽ‰ A lot happened since 50 stars: new APIs, stricter guards, more real OSS usage, and even an Effect type inference bug discovered through an is-kit guard. ๐Ÿ˜ธ I wrote about what changed between 50 โ†’ 100 ๐Ÿ‘‡ dev.to/nyaomaru/is-kit-reached-100โ€ฆ

dev.tois-kit Reached 100 Stars โญ๐ŸŽ‰ Hereโ€™s What Changed Since 50Hoi hoi! YAY! is-kit just reached 100 GitHub starsโญ ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ When it reached 50 stars, I wrote about how...

is-kit v1.16.0 is out ๐ŸŽ‰ New: discriminatedUnionWithFallback It lets you handle future/unknown discriminant values explicitly while keeping downstream code on a finite union. Known but malformed variants still fail validation ๐Ÿ˜ธ https://github.com/nyaomaru/is-kit/releases/tag/v1.16.0 #TypeScript

github.comRelease v1.16.0 ยท nyaomaru/is-kitdiscriminatedUnionWithFallback adds an explicit fallback path for discriminated unions whose input may contain variants the current application does not know about yet.

changelog-bot v0.9.0 is out ๐Ÿš€ Every source change must now be accounted for: included in the release or recorded with an explicit exclusion reason. No silently disappearing changes. Deterministic structure, AI enrichment ๐Ÿ˜ธ https://github.com/nyaomaru/changelog-bot/releases/tag/v0.9.0

github.comRelease v0.9.0 ยท nyaomaru/changelog-botEvery source change must be accounted for: included in the release or recorded with an explicit exclusion reason.

Iโ€™m so used to typing `code .` in the terminal from years of using VS Code. But lately, when I want to use Codex, I keep typing `codex .` instead ๐Ÿ˜น Please tell me Iโ€™m not the only one. ๐Ÿ˜น

unknown isnโ€™t a problem to eliminate. Itโ€™s an honest description of a value you havenโ€™t verified yet. ๐Ÿ˜ธ Validate it without reaching for a schema by default: https://is-kit.dev/guides/validate-unknown-without-schema-library #TypeScript #OpenSource

is-kit.devValidate unknown in TypeScript Without a Schema Library | is-kitValidate unknown TypeScript values with small composable type guards and safeParse, without adopting a schema-first validation workflow.

I published a new TypeScript article โœ๏ธ How do you safely turn `unknown` into something useful without a full schema library? I walk through type guards, `struct`, `safeParse`, JSON boundaries, exact object validation, and where schema libraries still make more sense. #TypeScript #OpenSource

dev.toHow Do You Validate `unknown` in TypeScript Without a Schema Library? ๐Ÿ›ก๏ธHoi hoi! ๐Ÿ‘‹ I'm @nyaomaru, a frontend engineer who is obsessed with gamba. ๐Ÿ˜ธ๐Ÿฆ Recently, I was...

nyaomaru reposted

I wrote my own function to replace nonnull assertions but you donโ€™t have to. Use is-kit instead. You canโ€™t rely on typescript at runtime. Sometimes itโ€™s not a problem that can be solved with Zod.

`is-kit` passed 100 GitHub stars โญ๐ŸŽ‰ I started it as a small zero-dependency TypeScript type guard library, so itโ€™s really nice to see it gradually reaching more developers. ๐Ÿ˜ธ Thanks for all the feedback, issues, PRs, and stars!! github.com/nyaomaru/is-... #TypeScript #OpenSource

โ€œ0.8 feels safeโ€ ๐Ÿ˜น Thatโ€™s exactly what I wanted to avoid with changelog-bot. John and I expanded the WHY benchmark from 14 to 50 cases, then swept thresholds and compared precision, recall, and F1. Guess less. Measure more. #TypeScript #OpenSource

dev.toHow Do We Extract the โ€œWhyโ€ from a PR into a CHANGELOG with Jev? ๐Ÿค”Hoi hoi! ๐Ÿ‘‹ I'm @nyaomaru, a frontend engineer currently building an AI-assisted CHANGELOG generator...

unknown is doing its job. An API response doesnโ€™t become a User just because our app expects one. ๐Ÿ˜ธ The interesting part is how we establish trust at runtime and whether every boundary really needs a full schema library. #TypeScript #OpenSourc

Really happy to share that my TypeScript Compiler API article was featured in DEVโ€™s Top 7 Posts of the Week! ๐Ÿ˜ธ๐ŸŽ‰ Iโ€™m honestly really happy to be featured again!! Huge thanks to the DEV team for featuring it, and congrats to all the other authors too! ๐Ÿš€ dev.to/devteam/top-... #TypeScript #OpenSource

dev.toTop 7 Featured DEV Posts of the WeekWelcome to this week's Top 7, where the DEV editorial team handpicks their favorite posts from the...

For a library, the source code isnโ€™t the final artifact. The packed npm package is. That became very obvious during my tsup โ†’ tsdown migration, so I tested the actual tarball in temporary ESM, CJS, and TypeScript consumers. Full write-up tomorrow. ๐Ÿ”ง #TypeScript #OpenSource

A small tsup โ†’ tsdown migration surprise. Before: index.mjs index.js index.d.ts First tsdown build: index.mjs index.cjs index.d.mts index.d.cts The build passed. Nothing was โ€œwrongโ€ with tsdown, but reasonable new defaults can still break an existing package contract. ๐Ÿ‘€ #TypeScript #OpenSource

What if AI didnโ€™t write the โ€œWhyโ€ in a CHANGELOG at all? In changelog-bot v0.7.0, Jev can select rationale already present in the PR description instead of generating new prose. Less invention. More grounding. Still experimental, but I like the direction. ๐Ÿ‘€ #OpenSource #AI #DevTools

A green build doesnโ€™t always mean a safe release. ๐Ÿ‘€ I migrated a real TypeScript OSS library from tsup to tsdown. The config change was tiny. The build passed. But the generated package no longer matched its existing contract. Full write-up Wednesday. ๐Ÿ”ง #TypeScript #OpenSource #tsdown

changelog-bot v0.7.0 ๐Ÿš€ Experimental TypeSafe Jev support for WHY extraction is here. It selects rationale in PR descriptions instead of generating prose. Huge thanks to github.com/johnnylemonny! ๐Ÿ™Œ github.com/nyaomaru/cha... #OpenSource #TypeScript #CHANGELOG #DevTools

github.comRelease v0.7.0 ยท nyaomaru/changelog-botWhat's new ๐Ÿš€ v0.7.0 introduces experimental TypeSafe Jev support for WHY extraction. Jev is an opt-in WHY-only engine that performs confidence-aware candidate selection instead of generating new pr...

TypeScript 7 changed the Compiler API surface, but one thing surprised me: a broad `ast.Node` still isnโ€™t a closed discriminated union. So `kind === CallExpression` doesnโ€™t replace `isX` narrowing for that input. Full write-up tomorrow. ๐Ÿ”ง #TypeScript #CompilerAPI

What does `arguments[0]` actually prove? Nothing, if the array is empty. A reusable guard for the first argument needs to prove: 1. index 0 exists 2. the value matches 3. the parent type remembers both facts Tiny runtime check, surprisingly interesting type problem. #TypeScript

is-kit v1.15.0 is out! ๐Ÿš€ A discussion about type-guard drift led to `discriminatedUnion`. It checks union coverage at compile time, so missing, extra, or mismatched branches canโ€™t silently slip through. ๐Ÿ‘€ github.com/nyaomaru/is-... #TypeScript #OpenSource #is-kit

github.comRelease v1.15.0 ยท nyaomaru/is-kitWhat's new ๐Ÿš€ Exhaustively validate discriminated unions discriminatedUnion creates one type guard from a finite discriminated union. It requires every discriminant value in both the values tuple an...

Optional AST children hide a different problem. `initializer?: Expression` isnโ€™t just โ€œanother property to narrow.โ€ A reusable guard must first prove that the property exists, then refine its value. That runtime contract deserves to be explicit. #TypeScript #OpenSource

TypeScript 5.5 added inferred type predicates, which is great. But a compound check like: `CallExpression โ†’ expression โ†’ Identifier` can still end up as plain `boolean` when extracted. So where exactly does reusable narrowing stop being โ€œfreeโ€? ๐Ÿ‘€ #TypeScript

A type guard can prove both the parent and a child property at runtime. But if you extract the check into a reusable function, does TypeScript preserve both facts? `CallExpression โ†’ expression โ†’ Identifier` That small question turned into a bigger TypeScript rabbit hole. ๐Ÿ˜ธ #TypeScript #WebDev

This week Iโ€™ve been sharing one TypeScript maintenance problem: A hand-written type guard can keep compiling even after the type it claims to validate has changed. Tomorrow Iโ€™ll publish the full write-up โ€” including drift, optional fields, nested types, and where `typedStruct` fits. ๐Ÿ”ง #TypeScript