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

Update docs for ascendNaturally and descendNaturally #3474

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

Harris-Miller
Copy link
Contributor

While working on ramda/types#127 I noticed that the block comment docs are a bit off because of how these are implemented

https://github.com/ramda/ramda/pull/3442/files#diff-2f0444491e08d72d422c4e936a1e621a9a3fdb85d20da37118526f4df5bb5ddaR35

.localeCompare only exists on the prototype of string. This means that the compare function for ascendNaturally and descendNaturally need to return String, and not Ord. Ord is defined as number | string | boolean | Date, which are the only types in javascript you can use <, >, <=, and >= on. This makes since for ascend and descend of course, but trying those with ascendNaturally and descendNaturally will give you a runtime error

Copy link

Coverage Summary
> ramda@0.30.1 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1192 passing (1s)


=============================== Coverage summary ===============================
Statements   : 94.06% ( 2486/2643 )
Branches     : 85.76% ( 970/1131 )
Functions    : 93.28% ( 555/595 )
Lines        : 94.34% ( 2332/2472 )
================================================================================

@Harris-Miller
Copy link
Contributor Author

CC: @sebbayer

@kedashoe kedashoe merged commit 0be4573 into ramda:master Jun 19, 2024
5 checks passed
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.

None yet

2 participants