TypeScriptで実行時型検査
runtimeで型チェックをしたいmrsekut.icon
開発環境のみ、もっと言えばフラグを立てたときのみでもいい
ユースケースとしては、サーバーサイドの型がゆるいせいで、クライアントのデータと型がずれることがたまにある
チェックする際に、consoleを挟んで差分を見ないといけないが、それがめんどい
動的な型チェックをしないと実装できないような実装をしているわけではない
Typia
Zod
Valibot
ArkType
io-ts
Yup
Joi
@recoiljs/refine
unknownutil
https://github.com/jsr-core/unknownutil
Superstruct
https://github.com/ianstormtaylor/superstruct
Vest
https://github.com/ealush/vest
Computed Types
https://github.com/neuledge/computed-types
Joi like validations for TypeScript
class-validator
Nope
https://github.com/bvego/nope-validator
Computed Types
https://github.com/neuledge/computed-types
Typanion
https://github.com/arcanis/typanion
runtypes
Typist JSON
https://zenn.dev/kawmra/articles/0aad8dca56f1da
typebox
https://github.com/sinclairzx81/typebox
/miyamonz-projects/typebox
Ajv
tynder
型定義から実行時型検査用の関数を自動生成する
ts-auto-guard
https://github.com/rhys-vdw/ts-auto-guard
type-predicates-generator
https://github.com/d-kimuson/type-predicates-generator
https://zenn.dev/kimuson/articles/type_predicates_generator
typescript-is
https://github.com/woutervh-/typescript-is
ttypescriptを使って、build時に実行時型検査用の関数を生成する
https://github.com/cevek/ttypescript
/miyamonz-projects/ランタイムで型を扱うtypescriptのライブラリ調査
https://tech.mobilefactory.jp/entry/2021/12/10/000000