Skip to content

v1.17.1

Latest

Choose a tag to compare

@nyaomaru nyaomaru released this 04 Dec 18:21
· 12 commits to main since this release
Immutable release. Only release title and notes can be modified.
cee5b24

is-kit v1.17.1 is out! πŸŽ‰πŸ˜Έ

This release focuses on making is-kit more reliable, predictable, and easier to understand.

We received 10 community contributions from 7 contributors, including 6 new contributors joining us for the first time! πŸ™Œ

It's wonderful to see more developers helping us improve is-kit, one small contribution at a time.

πŸ› οΈ More Reliable Record Validation

recordOf now validates all own string-keyed properties, including non-enumerable properties.

import { isString, isNumber, recordOf } from 'is-kit';

const isNumberRecord = recordOf(isString, isNumber);

const value = { id: 1 };

Object.defineProperty(value, 'hidden', {
  value: 'not a number',
  enumerable: false
});

isNumberRecord(value);
// Before: true
// Now: false

Previously, non-enumerable properties could bypass validation even though they remained accessible through the narrowed record type.

This fix makes runtime validation more consistent with the type contract.

Compatibility note: Objects containing non-enumerable string-keyed properties that fail either guard are now rejected. Symbol-keyed properties remain outside the validation scope.

Thanks to @tylrcc for continuing to improve the reliability of is-kit! πŸ˜ΈπŸ’š

#429

πŸ“¦ Understanding Our Bundle Size

How much does importing an is-kit guard actually add to your production bundle?

Thanks to @geekgod382, we now have reproducible bundle-size measurements for common import patterns using esbuild and Rollup + Terser.

Here are some of the measured results for is-kit v1.17.0:

Import pattern esbuild (gzip) Rollup + Terser (gzip)
isString 1,023 B 338 B
or(isString, isNumber) 1,026 B 417 B
refineKey('value', isString) 1,041 B 370 B
struct + safeParse 1,559 B 920 B
All runtime exports 3,614 B 3,350 B

These are measured fixture bundle sizes, not package download sizes. Actual application bundle sizes may vary depending on your bundler, configuration, target, and usage.

The investigation also identified interesting opportunities to improve tree-shaking, which we can explore in future releases.

Small. Simple. Useful. And hopefully even smaller in the future! 🐈

πŸ“š Clearer Documentation and Stronger Tests

Small runtime guarantees matter.

Knowing when a guard runs, when validation stops, and how exceptions propagate helps developers use is-kit with confidence.

This release improves documentation and regression coverage for:

  • hasKey and hasKeys property-presence semantics.
  • assert validation failures and guard exceptions.
  • and, andAll, and oneOf evaluation behavior.
  • typedStruct and its exact option.
  • safeParse and safeParseWith exception propagation.
  • isPlainObject prototype and cross-realm behavior.
  • Error propagation across all five nullish wrappers.

We also improved our contributor onboarding guide and introduced automated type-checking for a selected documentation example.

Welcome, New Contributors! πŸŽ‰πŸ˜Έ

A very warm welcome to our 6 new contributors!

  • @ACatNight improved our contributor onboarding experience and introduced automated type-checking for a documentation example.

    Thank you for making it easier for future contributors to get started!

    #488

  • @s1reyash contributed an amazing 4 documentation improvements, making several important runtime behaviors much easier to understand!

    • hasKey and hasKeys: #490
    • assert: #491
    • and and andAll: #492
    • isPlainObject: #505
  • @Divyanshgupta2580 documented the typedStruct exact option with clear examples of default and exact validation behavior.

    #501

  • @chsousaa clarified the distinction between validation failures and guard exceptions in safeParse and safeParseWith.

    #502

  • @ansonlam23 added regression tests for all five nullish wrappers, carefully verifying that the original error instance propagates unchanged.

    #503

  • @geekgod382 investigated production bundle impact and tree-shaking behavior, giving us reproducible measurements and valuable insights for future improvements.

    #504

And a big thank you to our returning contributor, @tylrcc, for the recordOf bug fix and regression tests!

#429

Whether you're improving documentation, writing tests, fixing bugs, or investigating performance, every contribution matters.

Thank you for spending your time and sharing your knowledge with us.

Welcome to is-kit and the Necoz-OSS community! πŸˆπŸ’š

We're happy to have you here, and we look forward to building more small, simple, and useful things together!

What's Changed

  • docs(changelog): 1.17.0 by @github-actions[bot] in #487
  • docs: improve contributor onboarding and type-check guide examples by @ACatNight in #488
  • docs: document oneOf evaluation behavior by @nyaomaru in #489
  • fix: validate non-enumerable own properties in recordOf by @tylrcc in #429
  • docs: clarify hasKey and hasKeys presence-only checks by @s1reyash in #490
  • docs: clarify assert failure and guard-error behavior by @s1reyash in #491
  • docs: clarify and and andAll short-circuit behavior by @s1reyash in #492
  • docs: document typedStruct exact option by @Divyanshgupta2580 in #501
  • docs(parse): clarify guard error propagation in safeParse and safeParseWith by @chsousaa in #502
  • chore: remove obsolete Prettier formatting skill by @nyaomaru in #496
  • test: verify nullish wrappers propagate inner guard errors unchanged by @ansonlam23 in #503
  • docs: clarify isPlainObject prototype and cross-realm behavior by @s1reyash in #505
  • Added a small script to measure reproducible bundle size by @geekgod382 in #504
  • Release: 1.17.1 by @github-actions[bot] in #506

New Contributors

Full Changelog: v1.17.0...v1.17.1