Skip to content

Framework for numbers and string changes#61

Merged
abetwothree merged 2 commits into
masterfrom
framework-sync-07-14-2026
Jul 14, 2026
Merged

Framework for numbers and string changes#61
abetwothree merged 2 commits into
masterfrom
framework-sync-07-14-2026

Conversation

@abetwothree

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the TypeScript implementations of @tolki/str and @tolki/num with updated Laravel-style semantics: containsAll() no longer treats an empty needle list as a successful match, and numeric humanization/abbreviation no longer emits a spurious "-0" for small negative values that round to zero.

Changes:

  • Update Str.containsAll() (and thus Stringable#containsAll()) to return false when the needles iterable is empty, and add corresponding test coverage.
  • Update Num.summarize() sign handling to avoid returning "-0" when the summarized magnitude equals zero at the requested precision, and add corresponding test coverage.
  • Add changesets for both behavior fixes; update PHP stubs / function lists and a collections docs stub in support of framework parity/reference syncing.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/str/stubs/StrTest.php Updates Laravel stub test data provider for empty-needles containsAll case (reference parity).
packages/str/stubs/Str.php Updates Laravel stub implementation of containsAll to return false on empty needles (reference parity).
packages/str/src/str.ts Changes containsAll() to require at least one needle (empty iterable now returns false).
packages/str/fn-lists/StrTest-Function-List.txt Regenerated function list line mappings after stub change (generated file).
packages/str/fn-lists/Str-Function-List.txt Regenerated function list line mappings after stub change (generated file).
packages/str/tests/str.spec.ts Updates/extends tests to cover empty-needles containsAll returning false.
packages/num/stubs/NumberTest.php Adds Laravel stub tests for negative values rounding to zero not keeping the sign (reference parity).
packages/num/stubs/Number.php Updates Laravel stub summarize sign logic to avoid -0 (reference parity).
packages/num/src/num.ts Updates negative-branch summarize() sign handling to avoid emitting -0 when summary equals zero summary.
packages/num/fn-lists/NumberTest-Function-List.txt Regenerated function list line mappings after stub change (generated file).
packages/num/fn-lists/Number-Function-List.txt Regenerated function list line mappings after stub change (generated file).
packages/num/tests/num.spec.ts Adds tests ensuring abbreviate()/forHumans() don’t return -0 for small negatives that round to zero.
docs/stubs/collections.md Updates collections docs stub to include reduceInto reference and additional guidance (reference content).
.changeset/quiet-numbers-round-safely.md Patch changeset documenting the -0 output fix for @tolki/num.
.changeset/empty-needles-return-false.md Patch changeset documenting the empty-needles behavior fix for @tolki/str.

@abetwothree
abetwothree merged commit 826d937 into master Jul 14, 2026
5 checks passed
@abetwothree
abetwothree deleted the framework-sync-07-14-2026 branch July 14, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants