Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

is-kit Reached 100 Stars – What Changed Since 50

Описание и применение

is-kit достиг 100 звезд: добавлены новые API для уточнения свойств, расширенный проверщик дискретных объединений, более строгие проверки и улучшенная совместимость с разными средами. Библиотека теперь используется в других проектах и помогла выявить ошибку типовой инференции в Effect TS.

Задача

Developers need reusable runtime type guards that integrate smoothly with TypeScript control flow and can be composed across projects.

Результат

The library evolved to support property refinement, exhaustive discriminated unions, stricter semantics, and broader environment compatibility. It is now adopted in multiple OSS projects and helped uncover a subtle TypeScript inference bug in Effect TS.

Рабочий процесс

  • 1. Identify a need for property‑level refinement of existing type guards.
  • 2. Implement refineKey, refineDefinedKey, and refineIndex to lift a guard onto a property or array index.
  • 3. Add discriminatedUnion to generate exhaustive validators for union types, checking for missing or extra branches.
  • 4. Tighten existing APIs (e.g., recordOf, struct) for stricter runtime checks and better error handling.
  • 5. Expand test coverage to ESM, CommonJS, Deno, and JSR environments.
  • 6. Integrate is-kit into other OSS projects (e.g., changelog-bot) using define for reusable predicates.
  • 7. Resolve a real‑world bug where is-kit’s unknown refinement caused type inference issues in Effect TS, leading to a PR that introduced NoInfer.
  • 8. Document changes and share lessons learned in a blog post.

Доказательства

"The library gained new APIs, some existing APIs became stricter, I started using it in more of my own OSS projects, and one real‑world use case even exposed a type inference edge case in Effect."

Источник

"is-kit added three property refinement helpers: refineKey, refineDefinedKey, refineIndex."

Источник

"The biggest addition since the 50-star article is probably the exhaustive discriminated union API introduced in v1.15.0."

Источник

"Recent releases included fixes around: recordOf literal-key narrowing, native Error brand checks, array guards with overridden iterators, exact struct validation, symbol-keyed struct schemas, cross-realm struct schemas."

Источник

"I started using is-kit more naturally in other OSS projects I maintain. For example, in my changelog tooling of changelog-bot, I use define to keep small predicates reusable and composable."

Источник

"An is-kit guard ran into an Effect type bug. The refinement could affect generic inference in an unexpected way. The reported case resulted in this Effect PR."

Источник

  • Дата записи: 2026-10-25T12:26:25.423Z