Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add castComparator function #34

Merged
merged 12 commits into from
Jul 14, 2024
Merged

feat: add castComparator function #34

merged 12 commits into from
Jul 14, 2024

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Jun 27, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Description

The compare function creates a comparator based on a given mapping function or property name. It provides type safety in the form of a new Comparable type that ensures the mapping function or property name results in a value compatible with > and < operators.

Checklist

  • Changes are covered by tests if behavior has been changed or added
  • Tests have 100% coverage
  • If code changes were made, the documentation (in the /docs directory) has been updated

Resolves

Bundle impact

Status File Size Difference (%)
A src/casted/castComparator.ts 168 +168
M src/casted/castMapping.ts 116 +0 (+0%)

@aleclarson aleclarson force-pushed the feat/compare-fn branch 2 times, most recently from 9a65ddf to 67b8c32 Compare June 27, 2024 22:48
@aleclarson aleclarson marked this pull request as ready for review June 27, 2024 23:04
@aleclarson aleclarson added the new feature This PR adds a new function or extends an existing one label Jun 28, 2024
@aleclarson aleclarson force-pushed the main branch 4 times, most recently from 35fc67a to 04bad7b Compare July 1, 2024 19:17
@aleclarson aleclarson force-pushed the main branch 2 times, most recently from 2154f96 to 6a4b4f6 Compare July 12, 2024 00:23
@aleclarson aleclarson changed the title feat: add compare function feat: add castComparator function Jul 13, 2024
@aleclarson aleclarson merged commit ddc114c into main Jul 14, 2024
4 checks passed
@aleclarson aleclarson deleted the feat/compare-fn branch July 14, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This PR adds a new function or extends an existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant