feat(nanoviews): rename the truthy and falsy narrowing types - #211
Merged
Conversation
`TruthyValueOrSignal` and `FalsyValueOrSignal` are named after a union that no longer exists, and `TruthySignal`/`FalsySignal` were never about signals at all: all four test `Accessor`. The suffix now says which input each one takes. `TruthyAccessor` and `FalsyAccessor` narrow something that has to be an accessor and answer `never` to anything else; `TruthySignalish` and `FalsySignalish` narrow a value that may not be one - the same opposition `AccessorValue` and `SignalishValue` carry.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #211 +/- ##
=======================================
Coverage 85.33% 85.33%
=======================================
Files 139 139
Lines 3143 3143
Branches 591 591
=======================================
Hits 2682 2682
Misses 332 332
Partials 129 129 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four types in
nanoviewsnarrow a value by whether it is truthy, andif_hands two of them to its branches:Their names were wrong in two different ways.
TruthyValueOrSignalandFalsyValueOrSignalwere named afterValueOrAccessor, which becameSignalishin #210 — so they were left pointing at a union that no longer exists.TruthySignalandFalsySignalwere never about signals: like their siblings they testAccessor, and answerneverfor anything that is not one.The suffix now carries the only thing that separates the two pairs:
-Accessorrequires an accessor and givesneverto anything else,-Signalishalso takes a plain value. That is the same oppositionAccessorValueandSignalishValuealready carry.No aliases: the package is not published yet.
TruthyAccessorandFalsyAccessorhave no consumer anywhere in the monorepo — they could be deleted instead of renamed, which is a separate call to make.Types only: every bundle is byte-identical and no pin moves. 114 tests, lint and
tsc --noEmitgreen.