Repository navigation
Releases
v1.16.6
is-kit v1.16.6 is out! 🎉😸
This release got a lot of help from the community, and we welcomed 9 new contributors! 🙌
Welcome, New Contributors! 🎉
-
@tridev-tej strengthened
safeJsonParseregression coverage, making sure guard errors propagate unchanged.
#431- Thank you for helping lock down an important error-handling contract! 😸🙌
-
@chirag-gupta7 added coverage for object reference identity in
equalsand came back with another contribution coveringguardInforwarding behavior.
#445
#449- Two contributions in one release! Thanks for helping make these small runtime contracts more explicit and reliable. 🐈💚
-
@agenticsymphony-tech improved the
safeJsonParsedocumentation by clarifying its error boundaries and what it does — and does not — catch.
#446- Thanks for making the behavior easier for users to understand at runtime boundaries! 🙌
-
@daocuong11 jumped into several parts of the project — improving the PR contribution checklist, strengthening
notruntime coverage, and updating staletsupdocumentation totsdown.
#447
#455
#456- Three contributions in one release! Thank you for helping with both contributor experience and library reliability. 🎉🐈
-
@wathsalaggg added focused regression tests proving that
hasKeyandhasKeyscheck property presence without reading property values.
#454- Thank you for helping protect this subtle but important runtime behavior! 😸🙌
-
@atokim4 made the difference between
optional,optionalKey, andoptionalKey(optional(...))much easier to understand, including real API / JSON payload examples.
#457- Thanks for turning a subtle API distinction into documentation that is much easier to use in practice! 🐈💚
-
@deba2k5 documented the runtime contract of
oneOfValues, includingObject.isequality, argument and array forms, and snapshot behavior.
#459- Thank you for making these edge cases visible and predictable for users! 🙌
-
@Lil-Clanky documented
tupleOfbehavior around exact lengths, sparse arrays, evaluation order, and short-circuiting.
#460- Thanks for helping expose the small runtime guarantees that make composable guards easier to trust! 😸🐈
-
@ArnabOPP expanded the
oneOfdocumentation around discriminated-union narrowing, explicit input domains withnot, and overlapping structural unions.
#461- Thank you for helping make some of the deeper TypeScript narrowing behavior much easier to understand! 🎉🙌
Thank you so much to everyone who contributed to v1.16.6!
Seeing more people jump into is-kit, improve different parts of the project, and help make its behavior clearer and more reliable is really exciting. 😸💚
Welcome to is-kit, and welcome to Necoz!
What's Changed
- docs(changelog): 1.16.5 by @github-actions[bot] in #428
- test: verify or evaluation order and short-circuit behavior by @tylrcc in #423
- test(parse): assert safeJsonParse guard errors propagate unchanged by @tridev-tej in #431
- test(equals): cover object reference identity by @chirag-gupta7 in #445
- docs: welcome contributors and clarify contribution workflow by @nyaomaru in #448
- docs: clarify safeJsonParse error boundaries (#437) by @agenticsymphony-tech in #446
- docs(template): add contributor checklist to PR template (#444) by @daocuong11 in #447
- test(logic): verify guardIn forwarding behavior by @chirag-gupta7 in #449
- fix: serve default locale from root by @nyaomaru in #453
- test(key): verify hasKey and hasKeys do not read property values by @wathsalaggg in #454
- docs: update stale tsup references to tsdown (#439) by @daocuong11 in #456
- test(core): strengthen not forwarding and error behavior (#435) by @daocuong11 in #455
- docs: compare optional, optionalKey and optionalKey(optional) in struct docs by @atokim4 in #457
- docs: document oneOfValues equality, input forms and snapshot behavior by @deba2k5 in #459
- docs: clarify tupleOf length, sparse tuple, and evaluation behavior by @Lil-Clanky in #460
- docs(one-of): clarify discriminated-union narrowing semantics by @ArnabOPP in #461
- Release: 1.16.6 by @github-actions[bot] in #462
New Contributors
- @tridev-tej made their first contribution in #431
- @chirag-gupta7 made their first contribution in #445
- @agenticsymphony-tech made their first contribution in #446
- @daocuong11 made their first contribution in #447
- @wathsalaggg made their first contribution in #454
- @atokim4 made their first contribution in #457
- @deba2k5 made their first contribution in #459
- @Lil-Clanky made their first contribution in #460
- @ArnabOPP made their first contribution in #461
Full Changelog: v1.16.5...v1.16.6
v1.16.5
is-kit v1.16.5 is out! 🎉😸
This release got a lot of help from the community again and we welcomed 6 new contributors! 🙌
Welcome, New Contributors! 🎉
- painbaba fixed a subtle soundness issue in
oneOfValues, making array inputs stable even if the original array is mutated later.
#400- Thank you for finding and fixing such an important edge case! 🙌
- saimskywalker improved
isPlainObjectso objects with custom null-prototype parents are no longer incorrectly accepted.
#406- Thanks for helping make the runtime behavior more trustworthy! 😸
- GyulianoDev added regression coverage for short-circuit behavior in
arrayOfandnonEmptyArrayOf.
#414- Thank you for helping us lock down predictable evaluation behavior! 🙌
- BoteroAlejandro11 added focused short-circuit tests for
mapOf, covering both key and value guard failures.
#416- Thanks for making the collection guard behavior even more robust! 🐈
- srijavuppala strengthened the runtime tests for
assert, including exact input forwarding, single guard evaluation, and unchanged error propagation.
#417- Thank you for helping us make these small but important runtime contracts explicit! 😸🙌
- tylrcc jumped into several areas at once — documenting runtime compatibility and adding regression coverage for
narrowKeyTo,setOf, anddefine.
#422
#424
#425
#426- Four contributions in one release! Thank you so much for jumping in and helping strengthen both the docs and runtime behavior. 🎉🐈
😸 And thanks again!
- diyaryavuz came back with another contribution, adding detailed runtime and type-level coverage for nested unknown and readonly refinement boundaries.
#397- Really appreciate you contributing again and continuing to make the refinement APIs more reliable! 🙌
Thank you so much to everyone who contributed to v1.16.5!
I’m really happy to see is-kit becoming something more people are helping to build together. 😸💚
Stay a Good Cat! 🐈
What's Changed
- docs(changelog): 1.16.4 by @github-actions[bot] in #396
- test: cover nested unknown and readonly refinement boundaries by @diyaryavuz in #397
- fix: snapshot oneOfValues array inputs to preserve literal narrowing by @painbaba in #400
- fix(cli): reject unknown and repeated init-agent options by @lanangptraa in #403
- docs: design principles and best practices by @nyaomaru in #405
- fix: reject custom null-prototype parents in isPlainObject by @saimskywalker in #406
- ci: assign pull request authors automatically by @nyaomaru in #407
- test(combinators): cover array guard short-circuiting by @GyulianoDev in #414
- test(combinators): cover mapOf short-circuit guard behavior by @BoteroAlejandro11 in #416
- test: strengthen assert runtime guard behavior by @srijavuppala in #417
- docs: clarify runtime compatibility requirements by @tylrcc in #422
- docs: add real-world trust boundary examples by @nyaomaru in #421
- test: cover narrowKeyTo base-guard short-circuit behavior by @tylrcc in #424
- test: cover setOf short-circuit behavior by @tylrcc in #425
- test: strengthen define runtime regression coverage by @tylrcc in #426
- Release: 1.16.5 by @github-actions[bot] in #427
New Contributors
- @painbaba made their first contribution in #400
- @lanangptraa made their first contribution in #403
- @saimskywalker made their first contribution in #406
- @GyulianoDev made their first contribution in #414
- @BoteroAlejandro11 made their first contribution in #416
- @srijavuppala made their first contribution in #417
- @tylrcc made their first contribution in #422
Full Changelog: v1.16.4...v1.16.5
v1.16.4
Welcome, New Contributors! 🎉
A big welcome and thank you to our new contributors in this release! 😸
-
@diyaryavuz strengthened
tupleOfwith additional edge-case and guard-evaluation coverage in #377. Thanks for helping make tuple validation behavior more robust and predictable! 🙌 -
@Pratham2511 expanded the regression coverage for
safeParseandsafeParseWithin #384, then came back with additional sparse-array coverage forarrayOfandnonEmptyArrayOfin #393. Really happy to see you jumping in again! 🐈 -
@Aaqibhafeezkhan added focused tests for
oneOfevaluation order, short-circuiting, and error propagation in #385. Thanks for helping lock down these important runtime semantics! 👍 -
@crims0n strengthened
predicateToRefineruntime coverage in #386, including predicate calls and composition withand. Thanks for improving the reliability of this small but useful building block! 🙌 -
@Doomguy-BFG9000 added regression coverage for
lazyto ensure initialized predicates remain cached even when predicate evaluation throws in #392. Thanks for the thoughtful test coverage and careful validation! 😸 -
@psjdeveloper improved the runtime coverage for
definein #394, covering boolean coercion, input forwarding, and predicate invocation behavior. Thanks for taking the initiative and contributing! 🎉
We're really happy to have all of you contributing to is-kit and the Necoz community.
Thanks and we hope to see you around again! 😸
What's Changed
- docs(changelog): 1.16.3 by @github-actions[bot] in #375
- test: cover tupleOf edge cases and guard evaluation by @diyaryavuz in #377
- test: expand safeParse and safeParseWith edge-case coverage by @Pratham2511 in #384
- test: verify oneOf evaluation order and short-circuiting by @Aaqibhafeezkhan in #385
- test(core): cover predicateToRefine call behavior by @crims0n in #386
- fix: support TypeScript 5.4 declarations by @nyaomaru in #391
- test(lazy): preserve cached predicate after invocation errors by @Doomguy-BFG9000 in #392
- test: cover sparse arrays with undefined-accepting guards by @Pratham2511 in #393
- test: improve define predicate coverage by @psjdeveloper in #394
- Release: 1.16.4 by @github-actions[bot] in #395
New Contributors
- @diyaryavuz made their first contribution in #377
- @Pratham2511 made their first contribution in #384
- @Aaqibhafeezkhan made their first contribution in #385
- @crims0n made their first contribution in #386
- @Doomguy-BFG9000 made their first contribution in #392
- @psjdeveloper made their first contribution in #394
Full Changelog: v1.16.3...v1.16.4
v1.16.3
What's new 🚀
This release includes documentation improvements, stronger type-level regression coverage, and our move to the Necoz organization! 😸
Welcome, New Contributors! 🎉
A big welcome and thank you to our three new contributors!
- @guhcostan improved the documentation for
safeParse, making tagged-result semantics easier to understand. Thank you for helping make is-kit clearer! 😸 - @nuriadevs clarified the finite-number semantics of
isNumber, helping developers better understand its behavior. Thanks for the thoughtful documentation improvement! 🙌 - @AmirAbaris strengthened the type-level regression tests for
refineKey, helping us keep TypeScript inference reliable. Thank you for improving is-kit's robustness! 💪
We're happy to have you contributing to is-kit and the Necoz community!
Stay a Good Cat! 😸
What's Changed
- docs(changelog): 1.16.2 by @github-actions[bot] in #369
- docs: clarify safeParse tagged-result semantics (#359) by @guhcostan in #370
- docs: clarify isNumber finite-number semantics by @nuriadevs in #371
- chore: point GitHub links at necoz-oss by @nyaomaru in #373
- Release: 1.16.3 by @github-actions[bot] in #374
- test(core): strengthen refineKey type-level regression coverage by @AmirAbaris in #372
New Contributors
- @guhcostan made their first contribution in #370
- @nuriadevs made their first contribution in #371
- @AmirAbaris made their first contribution in #372
Full Changelog: v1.16.2...v1.16.3
v1.16.2
What's Changed
- docs(changelog): 1.16.1 by @github-actions[bot] in #363
- fix(ci): use patched runtimes for eMudhra CA mitigation by @nyaomaru in #364
- perf(struct): streamline field validation loops by @nyaomaru in #365
- test: cover nested object type inference by @nyaomaru in #366
- refactor(docs): share API catalog and card navigation by @nyaomaru in #367
- Release: 1.16.2 by @github-actions[bot] in #368
Full Changelog: v1.16.1...v1.16.2
v1.16.1
What's Changed
- docs(changelog): 1.16.0 by @github-actions[bot] in #352
- chore: pin Node.js 22.23.4 for the October 2026 security release by @nyaomaru in #353
- docs: reframe homepage around type-safe runtime boundaries by @nyaomaru in #356
- refactor: decouple combinators from deprecated helpers by @nyaomaru in #361
- Release: 1.16.1 by @github-actions[bot] in #362
Full Changelog: v1.16.0...v1.16.1
v1.16.0
What's new 🚀
Classify future discriminant values with an explicit fallback
discriminatedUnionWithFallback adds an explicit fallback path for discriminated unions whose input may contain variants that the current application does not know about yet.
This is useful at open boundaries such as:
- versioned APIs that may introduce new event types
- webhook or event-stream consumers
- plugin or protocol messages
- AST or schema versions where newer node kinds may appear
Known variants are still validated exhaustively with their existing guards. If an input uses a known discriminant but has an invalid shape, validation fails as usual.
Only an undeclared discriminant reaches the fallback factory.
The fallback is then transformed into one canonical variant, keeping the resulting union closed enough for an exhaustive switch.
import {
discriminatedUnionWithFallback,
isNumber,
oneOfValues,
typedStruct
} from 'is-kit';
type Event =
| { kind: 'click'; x: number; y: number }
| { kind: 'scroll'; delta: number };
const classifyEvent = discriminatedUnionWithFallback<Event>()(
'kind',
['click', 'scroll'],
{
click: typedStruct<Extract<Event, { kind: 'click' }>>()({
kind: oneOfValues('click'),
x: isNumber,
y: isNumber
}),
scroll: typedStruct<Extract<Event, { kind: 'scroll' }>>()({
kind: oneOfValues('scroll'),
delta: isNumber
})
},
{
tag: 'unknown',
create: (input, originalKind) => ({
input,
originalKind
})
}
);
const result = classifyEvent({
kind: 'hover',
target: 'button'
});
if (result.valid) {
switch (result.value.kind) {
case 'click':
result.value.x;
break;
case 'scroll':
result.value.delta;
break;
case 'unknown':
result.value.originalKind; // 'hover'
result.value.input;
break;
}
}For an undeclared input such as
{ kind: 'hover', target: 'button' }the decoder produces a canonical fallback variant
{
kind: 'unknown',
originalKind: 'hover',
input: { kind: 'hover', target: 'button' }
}This differs from silently accepting an open union, downstream code still sees a finite set of variants click, scroll, or unknown.
A malformed known branch does not fall through to unknown
classifyEvent({
kind: 'click',
x: 'invalid',
y: 24
});
// { valid: false }The fallback factory can also reject an undeclared variant explicitly by returning undefined.
const classifyEvent = discriminatedUnionWithFallback<Event>()(
'kind',
['click', 'scroll'],
guards,
{
tag: 'unknown',
create: (_input, originalKind) =>
originalKind === 'experimental'
? undefined
: { originalKind }
}
);Because fallback handling transforms the original input into a new canonical variant,
discriminatedUnionWithFallback returns a ParseResult decoder rather than a type guard. 👍
What's Changed
- fix(ci): allow freshly published JSR smoke tests by @nyaomaru in #344
- docs(changelog): 1.15.3 by @github-actions[bot] in #343
- fix: reject invalid struct schema fields by @nyaomaru in #346
- perf: iterate array guards by index by @nyaomaru in #347
- test: add packed package compatibility matrix by @nyaomaru in #348
- fix(docs): use dedicated OGP image by @nyaomaru in #350
- feat: add explicit fallback variants for discriminated union by @nyaomaru in #349
- Release: 1.16.0 by @github-actions[bot] in #351
Full Changelog: v1.15.3...v1.16.0
v1.15.3
What's Changed
- docs(changelog): 1.15.2 by @github-actions[bot] in #331
- fix(ci): use Jev for changelog WHY selection by @nyaomaru in #332
- fix: align recordOf literal-key narrowing by @nyaomaru in #333
- test(ci): add Deno JSR smoke test by @nyaomaru in #335
- fix: use native Error brand checks by @nyaomaru in #336
- perf(struct): optimize required-only exact validation by @nyaomaru in #341
- Release: 1.15.3 by @github-actions[bot] in #342
Full Changelog: v1.15.2...v1.15.3
v1.15.2
What's Changed
- docs(changelog): 1.15.1 by @github-actions[bot] in #321
- docs: note cloud agent toolchain and docs host by @nyaomaru in #326
- test: typecheck the packed package from ESM and CJS by @nyaomaru in #327
- fix: reject symbol-keyed struct schemas by @nyaomaru in #329
- Release: 1.15.2 by @github-actions[bot] in #330
Full Changelog: v1.15.1...v1.15.2
v1.15.1
What's Changed
- docs(changelog): 1.15.0 by @github-actions[bot] in #313
- chore: update non-major dependencies by @nyaomaru in #315
- docs: add documentation button in readme by @nyaomaru in #316
- docs: update README more understandable by @nyaomaru in #317
- docs: clarify is-kit landing page positioning by @nyaomaru in #318
- fix: avoid overridden iterators in array guards by @nyaomaru in #319
- Release: 1.15.1 by @github-actions[bot] in #320
Full Changelog: v1.15.0...v1.15.1