docs(website): correct the IsObject exact cost in the type-functions guide - #706
Merged
Merged
Conversation
…guide
Re-running scripts/bench-instantiations.mjs on main gives about 153
instantiations per `IsObject<T, { exact: true }>` call on TS 6.0 and 7,
at both 100 and 300 uses. The guide quoted about 140, a figure carried
over from #700. Every other figure in the Cost section still reproduces.
Refs #701
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #706 +/- ##
=========================================
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:
|
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 #701. This fixes the last gap in that issue.
Audit of #701's "Done when" list against
mainFilter<Array<…>, F>appliesF, with specsFilter/KeepMatch<Array<1 | { a: 1 }>, IsObject.$Fn>givesArray<{ a: 1 }>, and a no-match givesnever[], on TS 5.4, 6.0 and 7. Specs are inarray_plus.filter.spec.tsandfilter.spec.ts..$Fn, with a spec each$Fn.Apply<X.$Fn, 1>to all 62 compiles on TS 5.4 and 7, and every one has aX.$Fnspec in its own spec file. 63 one-input$Fns have theIsObject.$Fnshape (the 62 plusIsObject)..$Fnin the proposed shapeEqual,AssignableandNotAssignableuse$Fn<B, $O>, andHasKeyandIsOptionalKeyuse$Fn<K, $O>. All three examples from the issue compile.bench-instantiations.mjsIsObject≈ 24, ≈ 6 per entry,IsNotString.$Fn973 vs$Fn.Not<IsString.$Fn>1090, and anIsNot…saving of ≈ 117.IsObjectwithexactnow measures 153, at both 100 and 300 uses, but the guide said about 140, a figure carried over from #700.Change
IsObject+exactfigure from about 140 to about 150.Only the private
websiteapp changes, so there is no changeset.pnpm verifypasses.🤖 Generated with Claude Code