@coven/math rework#40
Merged
Merged
Conversation
`Stringable` instead of `string`.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
loucyx
commented
May 17, 2026
| import { compareField } from "../compareField.ts"; | ||
|
|
||
| Deno.test("Two equal values returns true", () => assert(compareField(13, 13))); | ||
| Deno.test("Two equal values returns true", () => assert(compareField(13)(13))); |
Contributor
Author
There was a problem hiding this comment.
compareField is curried now, so this required some changes.
Comment on lines
+13
to
+21
| assert( | ||
| dateInCronTest(Temporal.PlainDateTime.from("1989-05-05T05:05:00.000")), | ||
| ), | ||
| ); | ||
|
|
||
| Deno.test("Date outside the cron expression returns false", () => | ||
| assertFalse(dateInCronTest(new Date("2024-05-05T05:05:00.000Z").getTime())), | ||
| assertFalse( | ||
| dateInCronTest(Temporal.PlainDateTime.from("2024-05-05T05:05:00.000")), | ||
| ), |
Contributor
Author
There was a problem hiding this comment.
No more Date, we are in 2026 now.
Comment on lines
+19
to
+22
| export const compareRangeOrValue: Unary< | ||
| [value: number], | ||
| Filter<[valueOrRange: ValueOrRangeField<number>]> | ||
| > = memoFunction((value) => |
Contributor
Author
There was a problem hiding this comment.
Changed some files to rely more on @coven/types
Comment on lines
+17
to
+26
| if (rangeStringTest(value)) { | ||
| const [from, to] = value | ||
| .split(RANGE_EXPRESSION_SEPARATOR_TOKEN) | ||
| .map(parseDecimal) as [from: number, to: number]; | ||
|
|
||
| return from <= to; | ||
| } else { | ||
| return false; | ||
| } | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
Removed that hacky IIFE just to avoid a block.
| Deno.test("Groups captured correctly", () => | ||
| assertStrictEquals( | ||
| getGroups<readonly ["example"]>( | ||
| getGroups<Readonly<["example"]>>( |
Contributor
Author
There was a problem hiding this comment.
Changed some remaining readonly [...] with Readonly<[...]>
|
|
||
| Deno.test("Infinity + Infinity = Infinity", () => | ||
| assertStrictEquals(addInfinity(Infinity), Infinity), | ||
| Deno.test("Infinity + NaN = Infinity", () => |
Contributor
Author
There was a problem hiding this comment.
Precise no longer has a concept of Infinity, it's just NaN.
rightonhana
previously approved these changes
May 17, 2026
rightonhana
approved these changes
May 17, 2026
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.
@coven/mathnow uses abigintto store the coefficient and exponent instead of a tupple (heavily inspired by DEC64).@coven/cronhad a small change to useTemporalinstead ofDate(and some utils and types were adjusted too).@coven/typessome improvements here and there.