Skip to content

feat: add narrow for composable type-guard refinements with diagnostics#443

Merged
gjbkz merged 1 commit into
mainfrom
436-narrow-type-guard
Jul 20, 2026
Merged

feat: add narrow for composable type-guard refinements with diagnostics#443
gjbkz merged 1 commit into
mainfrom
436-narrow-type-guard

Conversation

@gjbkz

@gjbkz gjbkz commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • add the narrow() combinator for reusable subtype predicates
  • preserve custom and fallback structured diagnostics without affecting boolean validation
  • cover inference, interoperability, short-circuiting, nesting, and input identity

Tests

  • npm run lint
  • npm run test
  • bun test src --coverage --coverage-reporter=lcov
  • npm run build
  • ESM and CommonJS package-entry smoke tests

Closes #436

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.70%. Comparing base (69b8662) to head (08f78a4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #443      +/-   ##
==========================================
+ Coverage   97.63%   97.70%   +0.07%     
==========================================
  Files          48       49       +1     
  Lines        2541     2620      +79     
  Branches      260      275      +15     
==========================================
+ Hits         2481     2560      +79     
  Misses         60       60              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gjbkz
gjbkz merged commit cf19875 into main Jul 20, 2026
8 checks passed
@gjbkz
gjbkz deleted the 436-narrow-type-guard branch July 20, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat: add narrow for composable type-guard refinements with diagnostics

1 participant