feat(type-plus)!: merge Equal into IsEqual<$O>, migrate IsLiteral and Some (#707) - #709
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: f1fef6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #709 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 43 43
Lines 231 231
Branches 51 51
=========================================
Hits 231 231 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
unional
enabled auto-merge
September 23, 2026 05:34
… Some - IsEqual<A, B, $O> takes Equal's body and namespace; Equal is removed. Two distinct unique symbols (and a unique symbol vs symbol) now compare not equal. - IsNotEqual<A, B, $O> mirrors it; NotEqual is removed. The filter form answers #275. - IdentityEqual is removed in favor of IsEqual.$Same. - IsLiteral and Some take $O; Some's Mode folds into { mode }. - Remove CanAssign, StrictCanAssign, IsAssign, Extendable, NotExtendable, IsExtend and IsNotExtend. - Note the no-options design on IsDisjoint and the positional one on StringIncludes. Closes #707 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
unional
force-pushed
the
feat-is-equal-options-707
branch
from
September 23, 2026 07:27
8162096 to
f1fef6d
Compare
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.
Closes #707. Closes #334. Resolves #275: the filter form it asked for is
IsNotEqual<A, B, { selection: 'filter' }>, which keepsAwhen it differs fromB.What changed
1.
Equalmerged intoIsEqual.IsEqual<A, B, $O>now usesEqual's body and its namespace ($Options,$Default,$Branch,$Fn,$Same,$ToProps,_ExactEqual*).Equalis deleted. Its spec is folded intois_equal.spec.ts, and the function-parameter recursion now callsIsEqualitself. The commented-out alternate implementation was dropped.testType.equalstill goes throughIsEqualand is unchanged.$Optionsextends$Selection.Options(the full set, not the$BaseOptionsEqualused), so{ selection: 'filter' }works. Filter returnsA.IsNotEqual<A, B, $O>mirrors it and gains$Branchand$Fn.NotEqualis removed.IdentityEqualis removed. It had more callers than the issue listed:is_object.tsandis_not_object.tsused it too. All callers now useIsEqual.$Same.$O:ArrayPlus.Filter,ArrayPlus.IndexAt,Some.StrictArray.Behavior change (in the changeset): two distinct
unique symbols now comparefalse, and so does aunique symbolagainstsymbol. Two assertions flip:is_equal.spec.ts(testType.equal<typeof s, symbol>) andtuple.spec.ts:43(['a'] & symbolvssymbol).2.
IsLiteral<T, $O>is wired like the #677 types:$Options,$Defaultand$Branch, branches resolved through$ResolveBranch, filter returnsT.2b.
Some<A, Criteria, $O>. Decision on the open question:Modemoves into$Oas{ mode: 'strict' | 'loose' }, next toselectionand the branch overrides. This is the consistent answer, and 8.0.0 has no compatibility window to protect.Some<A, C, 'strict'>becomesSome<A, C, { mode: 'strict' }>. Filter returns the whole arrayA. The internal helpers take a pre-resolved{ $then; $else }object (Some._Branches). They recurse onTail<A>, so the filter subject has to be fixed to the wholeAbefore they run.3. Removed
CanAssign,StrictCanAssign,IsAssign,Extendable,NotExtendable,IsExtendandIsNotExtend.Extends.tsis deleted.CanAssign.tsnow holds only the runtimecanAssign(), whose types now useAssignableand an inline conditional. The internal call sites (PadStart,Some.LooseArray) useAssignable. Specs that usedCanAssign/StrictCanAssignas a tool now useAssignable(with{ distributive: false }where needed).4.
IsDisjointgets a TSDoc note explaining that it deliberately takes no options.StringIncludesgets a note explaining why it stays positional.Sweep
The multi-line sweep from the issue now returns only
StringIncludesandNotUnknownOr, plus the known false positives ($Selection.Invert,$Distributive.Parse,$Exact.Parse, and the_*OrElsehelpers).Docs
Migration guide: the old deprecated-alias table is gone. Every removal now sits in the "what moved in 8.0.0" table, and the symbol paragraph is now a behavior-change note. Also updated: the website API pages (equality, testing, array, type-guards-and-assertions, type-functions),
packages/type-plus/readme.md,src/array/readme.md,src/assertion/readme.md, and the regeneratedllms.txt.Error snapshot
Updated. The
options_Equal_typoprobe is replaced by typo and wrong-value probes forIsEqual,IsNotEqual,IsLiteralandSome.Some'smodeunion is declared'loose' | 'strict'because TS 5.4 and TS 7 print'strict' | 'loose'in different orders.Verification
pnpm verify:pkg: test:type on TS 5.4, 5.5, 5.6, 6.0 and 7, test:errors, build, verify:dts, coverage, size — all pass.pnpm docs:llms:checkpasses.pnpm verifyfailed in my worktree only because biome picked up a local, untracked.agents/file that CI never sees.🤖 Generated with Claude Code