Skip to content

For beta 1#65

Merged
baxyz merged 49 commits into
mainfrom
for-beta-1
May 5, 2026
Merged

For beta 1#65
baxyz merged 49 commits into
mainfrom
for-beta-1

Conversation

@baxyz

@baxyz baxyz commented May 2, 2026

Copy link
Copy Markdown
Contributor

Description

Please include a summary of what this PR does and why it's needed.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring
  • Test improvement

Related Issues

Closes #(issue number)

How Has This Been Tested?

Describe the tests you ran and how to reproduce them:

  • Test A
  • Test B

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests for my changes
  • All new and existing tests passed locally
  • My commits follow the conventional commit format

Screenshots (if applicable)

Add screenshots for UI changes.

Additional Context

Add any other context about the PR here.

Copilot AI review requested due to automatic review settings May 2, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown

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 refactors and expands equality/diff helpers across object/ and array/ for the “beta 1” milestone, replacing JSON-based comparisons with key/structural comparisons and introducing clearer API variants (equalsShallow, equalsDeep, diff, equalsUnordered).

Changes:

  • Reworked object/shallowEquals and array/shallowEquals to use shallow element/key comparisons instead of JSON.stringify.
  • Added new helpers: object/{equalsShallow,equalsDeep,diff} and array/{equalsShallow,equalsDeep,equalsUnordered}, plus corresponding tests/specs/examples/benches.
  • Renamed/removed older helpers (object/deepCompare, array/equals) and updated references.

Reviewed changes

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

Show a summary per file
File Description
helpers/object/shallowEquals.ts Replaces JSON stringify comparison with shallow key/value equality + updated JSDoc.
helpers/object/shallowEquals.test.ts Updates unit tests to match new shallow object equality semantics.
helpers/object/equalsShallow.ts New shallow object equality helper (currently duplicated logic).
helpers/object/equalsShallow.test.ts Unit tests for equalsShallow.
helpers/object/equalsShallow.spec.ts Property/contract specs updated to equalsShallow (wording still references JSON).
helpers/object/equalsShallow.example.ts Example updated to new helper name (description still mentions JSON.stringify).
helpers/object/equalsDeep.ts Adds boolean wrapper around diff.
helpers/object/equalsDeep.test.ts Unit tests for deep object equality wrapper.
helpers/object/equalsDeep.spec.ts Property-based tests for deep object equality wrapper.
helpers/object/equalsDeep.example.ts Adds examples for deep equality wrapper.
helpers/object/diff.ts Introduces structural diff with depth option (not cycle-safe; key handling needs hardening).
helpers/object/diff.test.ts Migrates deepCompare tests to diff and adds depth-option coverage.
helpers/object/diff.spec.ts Property/contract specs migrated to diff (one test title inconsistent).
helpers/object/diff.example.ts Updates examples to use diff.
helpers/object/diff.bench.ts Updates benchmark to use diff.
helpers/object/deepCompare.ts Removes old deepCompare implementation.
helpers/array/shallowEquals.ts Replaces JSON stringify comparison with positional === shallow equality.
helpers/array/shallowEquals.test.ts Removes unit tests for array/shallowEquals.
helpers/array/equalsUnordered.ts Adds order-independent array equality (current algorithm mishandles duplicates).
helpers/array/equalsUnordered.test.ts Updates tests to new helper name (formatting differs from repo conventions).
helpers/array/equalsUnordered.spec.ts Adds property/contract specs for unordered equality.
helpers/array/equalsUnordered.example.ts Updates examples to new helper name.
helpers/array/equalsShallow.ts Adds named shallow array equality helper (duplicates shallowEquals).
helpers/array/equalsShallow.test.ts Adds unit tests for equalsShallow.
helpers/array/equalsShallow.spec.ts Updates spec to new helper name (comments still reference JSON.stringify).
helpers/array/equalsShallow.example.ts Updates examples to new helper name (descriptions still reference JSON/old helper names).
helpers/array/equalsDeep.ts Adds recursive deep array equality helper (appears duplicated with deepEquals).
helpers/array/equalsDeep.test.ts Adds unit tests for deep array equality.
helpers/array/equalsDeep.spec.ts Updates property/contract specs to use equalsDeep.
helpers/array/equalsDeep.example.ts Updates examples to use equalsDeep.
helpers/array/equalsDeep.bench.ts Updates benchmark to use equalsDeep.
helpers/array/equals.ts Removes old unordered equality helper.
helpers/array/equals.spec.ts Removes specs for old equals.
helpers/array/deepEquals.ts Upgrades existing deep array equality to recursive structural comparison.
helpers/array/deepEquals.test.ts Updates tests to cover recursive structural behavior.
Comments suppressed due to low confidence (6)

helpers/array/equalsShallow.example.ts:26

  • The example description mentions JSON.stringify and refers to “equals”, but equalsShallow is now an index-by-index === comparison and the relevant contrasting helper is equalsUnordered. Please update the descriptions to reflect the current behavior and names.
    helpers/object/equalsShallow.example.ts:17
  • The example description still claims JSON.stringify-based comparison, but equalsShallow now does key/value checks and no longer stringifies. Please update the example text to match the current implementation/semantics (and note any important caveats, like nested objects being compared by reference).
    helpers/array/equalsShallow.spec.ts:61
  • Several comments in this spec still explain behavior in terms of JSON.stringify (e.g. for functions), but equalsShallow no longer uses JSON serialization. Please update the commentary so the spec documents the actual algorithm/contract being tested.
    helpers/object/equalsShallow.spec.ts:90
  • Several test names/comments still refer to JSON.stringify/try-catch behavior, but equalsShallow no longer uses JSON serialization. Updating the wording would prevent confusion and ensure the contract/spec reflects the actual algorithm being tested.
    helpers/array/equalsUnordered.test.ts:12
  • Code style: CONTRIBUTING.md calls for single quotes and 2-space indentation in this repo, but this test file uses double quotes and 4-space indentation. Aligning with the repo conventions will keep formatting consistent across helpers.
    helpers/object/diff.spec.ts:51
  • The test title says “null vs null → false …” but the assertion (and the inline comment) expect true. Please correct the title so it matches the actual expected behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helpers/array/equalsDeep.ts
Comment thread helpers/object/equalsShallow.ts
Comment thread helpers/object/equalsShallow.ts
Comment thread helpers/object/equalsDeep.ts
Comment thread helpers/array/equalsUnordered.ts
Comment thread helpers/object/diff.ts
Comment thread helpers/object/diff.ts
Comment thread helpers/array/equalsUnordered.ts Outdated
Comment thread helpers/object/shallowEquals.ts Outdated
Comment thread helpers/array/equalsShallow.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 194 out of 199 changed files in this pull request and generated 16 comments.

Comments suppressed due to low confidence (2)

helpers/object/equalsShallow.example.ts:18

  • The example description says it “Uses JSON.stringify”, but equalsShallow is implemented via key enumeration + === checks (no stringify). Update the description so it matches the actual algorithm/semantics.
    helpers/array/equalsShallow.example.ts:18
  • The description claims equalsShallow “Uses JSON.stringify”, but the implementation is an element-by-element === loop. Update the example text to avoid misleading users about behavior (notably NaN and nested reference semantics).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helpers/string/escapeHtml.test.ts Outdated
Comment thread helpers/promise/resolveRecord.spec.ts Outdated
Comment thread helpers/function/compose.example.ts
Comment thread helpers/function/compose.test.ts Outdated
Comment thread scripts/coherency/category/helper.ts Outdated
Comment thread helpers/array/without.ts
Comment thread helpers/array/equalsUnordered.ts
Comment thread scripts/coherency/category/index.ts
Comment thread helpers/promise/defer.ts Outdated
Comment thread helpers/ci/buildStatusTable.ts
@baxyz baxyz force-pushed the for-beta-1 branch 2 times, most recently from daf0e32 to 385ad68 Compare May 4, 2026 21:23
@baxyz baxyz requested a review from Copilot May 4, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 197 out of 202 changed files in this pull request and generated 10 comments.

Comments suppressed due to low confidence (2)

helpers/object/equalsShallow.example.ts:17

  • The description still claims this uses JSON.stringify, but equalsShallow is now a key/value strict-equality check (no serialization). Update the example description to match the actual algorithm/behavior.
    helpers/array/equalsShallow.example.ts:17
  • The description still claims this uses JSON.stringify, but equalsShallow is now a positional strict-equality check (no serialization). Update the example description to match the actual algorithm/behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/coherency/category/helper.ts Outdated
Comment thread helpers/ci/buildStatusTable.ts
Comment thread helpers/string/escapeHtml.test.ts Outdated
Comment thread helpers/number/mean.example.ts
Comment thread helpers/url/withoutLeadingSlash.spec.ts
Comment thread helpers/array/without.ts
Comment thread helpers/array/equalsUnordered.ts Outdated
Comment thread helpers/function/flip.ts
Comment thread helpers/promise/resolveRecord.test.ts
Comment thread helpers/promise/resolveRecord.spec.ts
Comment thread helpers/ci/buildStatusTable.ts Fixed
@baxyz baxyz requested a review from Copilot May 5, 2026 19:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 197 out of 202 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (5)

helpers/array/intersects.ts:17

  • The JSDoc text has a few grammar issues ("check" → "checks", "shared" → "share", "at least an item" → "at least one item") and the return line is indented with 4 spaces rather than the repo’s 2-space indentation convention (AGENTS.md:142).
    helpers/array/equalsUnordered.test.ts:13
  • This test file doesn’t follow the repo’s formatting conventions (single quotes + 2-space indentation; AGENTS.md:142). Please reformat (imports use double quotes and the body is indented with 4 spaces).
    helpers/array/intersects.test.ts:22
  • Indentation in this test file is 4 spaces, but the repo convention is 2 spaces (AGENTS.md:142). Since this hunk is already being edited for the rename, please reformat the block for consistency.
    helpers/object/equalsShallow.example.ts:18
  • The example description says this helper "Uses JSON.stringify", but equalsShallow now does a key-by-key === comparison (no JSON serialization). Please update the description to match the implementation to avoid misleading docs.
    helpers/array/equalsShallow.example.ts:18
  • The example description claims equalsShallow uses JSON.stringify, but the current implementation does a positional === loop (no JSON serialization). Please update the description so docs match behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helpers/array/equalsUnordered.ts
Comment thread helpers/promise/safeFetch.test.ts
Comment thread helpers/promise/safeFetch.spec.ts
Comment thread helpers/function/compose.example.ts
Comment thread helpers/function/compose.test.ts
Comment thread helpers/object/map.ts
Comment thread helpers/object/invert.ts Outdated
Comment thread helpers/string/capitalize.ts
Comment thread helpers/promise/safeFetch.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 197 out of 202 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (3)

helpers/object/equalsShallow.example.ts:17

  • The example description says this uses JSON.stringify, but equalsShallow now does a key-by-key shallow comparison. Please update the description to match the current implementation so the docs don’t mislead users.
    helpers/array/equalsShallow.example.ts:17
  • The example description mentions JSON.stringify, but array/equalsShallow is implemented as an index-by-index === comparison (no JSON serialization). Updating the description will keep the docs accurate.
    helpers/array/intersects.ts:17
  • Renaming the exported function from oneInCommon to intersects is a breaking API change for consumers importing oneInCommon. If you still want to standardize on intersects, consider re-exporting oneInCommon as an alias (potentially deprecated) to preserve compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helpers/ci/buildStatusTable.ts
Comment thread helpers/number/lerp.spec.ts Outdated
Comment thread helpers/object/map.ts
Comment thread helpers/array/equalsShallow.ts Outdated
Comment thread helpers/array/equalsDeep.ts Outdated
Comment thread helpers/array/equalsUnordered.ts Outdated
baxyz and others added 10 commits May 5, 2026 20:25
- delete deepEquals function and its tests
- delete equals function and its tests
- add equalsDeep for recursive structural equality
- add equalsShallow for positional one-level equality
- add equalsUnordered for order-independent equality
- add tests and examples for new equality functions
- implement `equalsDeep` for recursive structural equality
- implement `equalsShallow` for one-level equality
- add tests for both equality functions
- add examples for usage of equality functions
- delete uuid7.example.ts
- delete uuid7.spec.ts
- delete uuid7.test.ts
- delete uuid7.ts
- delete config.json
- add uuid7 function for generating UUID v7 strings
- create uuid7 example file with usage examples
- implement uuid7 tests for validation and uniqueness
- update settings to include 'id' scope
- change import from './types.model' to './types' in multiple files
- remove obsolete types.model.ts file
chore(type): 🔧 move Maybe type to its own file
- create Maybe.ts and update import in isDefined.ts
- remove Maybe.model.ts file
…onventions

Co-authored-by: Copilot <copilot@github.com>
baxyz and others added 27 commits May 5, 2026 20:25
- add lowercaseRest option to preserve original casing
- update examples and tests for new functionality
Co-authored-by: Copilot <copilot@github.com>
- implement escape function for Markdown special characters
- add property-based tests for escape function
- create examples for escape usage
- implement escapeTableCell for Markdown table cell safety
- add examples for escapeTableCell usage
- create property-based tests for escapeTableCell
- add unit tests for escapeTableCell functionality
- implement statusToBadge for CI status mapping
- implement statusToIcon for CI status emoji representation
- add examples and tests for both functions
- implement buildStatusTable for generating Markdown table rows
- add property-based tests for buildStatusTable
- add unit tests for buildStatusTable functionality
- enhance escape function to handle pipe and newline characters
- remove escapeTableCell function and related tests/examples

Co-authored-by: Copilot <copilot@github.com>
- implement leadingSentence function to extract the first sentence
- add examples for various sentence structures
- create property-based tests for leadingSentence function
- add unit tests for leadingSentence function
- implement flip function to swap first two arguments
- add examples for subtraction and division
- create property-based tests for flip functionality
- add unit tests for various use cases
- implement negate function to return logical negation of predicates
- add examples for usage in filtering and deriving predicates
- create property-based tests for negate functionality
- implement linear interpolation function
- add example usage in lerp.example.ts
- add property-based tests in lerp.spec.ts
- add unit tests in lerp.test.ts
- implement formatCompact for compact number formatting
- add examples for English and French locales
- create property-based tests for formatCompact
- add unit tests for various number formats
- implement template function for string interpolation
- add examples for usage
- create property-based and unit tests for template function
- add union example with lodash and ramda
- add select/filterMap example with radashi
- implement cartesian product logic
- add examples in cartesianProduct.example.ts
- add property-based tests in cartesianProduct.spec.ts
- add unit tests in cartesianProduct.test.ts
- implement defer function for LIFO callback execution
- add examples in defer.example.ts
- add property-based tests in defer.spec.ts
- add unit tests in defer.test.ts

Co-authored-by: Copilot <copilot@github.com>
- fix(array): make zip implementation accept readonly arrays
- fix(promise): add missing resolveRecord import in example
- fix(promise): wrap Array.push callbacks to return void in defer tests
- fix(object): use flatMap to avoid possibly-undefined in groupBy.spec
- fix(object): use string keys in invert example to fix type mismatch
- fix(examples): add missing description field to 14 ExampleDefinition entries
- fix(build): convert 11 plain-script example files to HelperExamples format
  (defer, cartesianProduct, countBy, without, flip, negate, formatCompact, lerp,
  escapeHtml, template, words) — loadExampleFiles crashed on missing default export
- fix(number): lerp early-return for t=0 and t=1 to preserve -0 sign identity
- assert version matches root package.json
- validate build date is present and parseable
- check totalCategories against actual category directories
- verify categories list matches actual directories
- ensure packages metadata count matches expected
- clarify index.ts re-export check is not needed
- throw error on dependency version mismatch
- fail on suspiciously small packages (<1KB)

Co-authored-by: Copilot <copilot@github.com>
@baxyz baxyz merged commit 155f865 into main May 5, 2026
15 checks passed
@baxyz baxyz deleted the for-beta-1 branch May 5, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants