Skip to content

Road to v1: API revamp#20

Open
mhluongo wants to merge 15 commits into1.0/monorepofrom
1.0/api-revamp
Open

Road to v1: API revamp#20
mhluongo wants to merge 15 commits into1.0/monorepofrom
1.0/api-revamp

Conversation

@mhluongo
Copy link
Member

Expand the Money API, loosening restrictions by default to make the experience easier for new developers.

Rounding and Number arguments can still be disabled via global library config.

Leaving it to app developers is unreasonable.
Down the road, we'll use them to point to documentation as appropriate.
... the idea here is to allow app devs to decide whether they want to
enforce strict precision without rounding, as well as simple stuff like
default config.
The constructor signature is (expected, actual, operation) but the 4 call
sites in bounds methods passed (operation, expected, actual), causing the
error's .expected and .actual fields to contain wrong values.
Replace parseFloat(value) fallback with FixedPointNumber.fromDecimalString()
to avoid floating-point precision loss when parsing bare numeric strings
in clamp/atLeast/atMost. Non-numeric strings now throw ParseError.
defaultRoundingMode, defaultCurrency, and strictPrecisions
Conditionally load AsyncLocalStorage from node:async_hooks so concurrent
Isolate withConfig scopes in Node
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.

1 participant

Comments