Skip to content

chore: upgrade dinero.js to v2.0.0 stable#33

Open
sarahdayan wants to merge 1 commit intovercel-labs:mainfrom
sarahdayan:chore/upgrade-dinero-v2
Open

chore: upgrade dinero.js to v2.0.0 stable#33
sarahdayan wants to merge 1 commit intovercel-labs:mainfrom
sarahdayan:chore/upgrade-dinero-v2

Conversation

@sarahdayan
Copy link

@sarahdayan sarahdayan commented Mar 5, 2026

Summary

Upgrades dinero.js from 2.0.0-alpha.8 to 2.0.0 (stable release) and migrates to the updated API:

  • toFormattoSnapshot: toFormat was removed. Use toSnapshot to access currency.code directly
  • toUnittoDecimal: toUnit was removed. toDecimal returns a string representation (e.g., "10.50")
  • toUnit rounding options → transformScale + rounding mode: toUnit(d, { digits: 0, round: up }) becomes toDecimal(transformScale(d, 0, up))

Migrate to the stable Dinero.js v2 API:

- Replace toFormat with toSnapshot for currency code access
- Replace toUnit with toDecimal (returns string instead of number)
- Replace toUnit rounding options with transformScale + rounding mode
- Update package.json and lockfile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 5, 2026

@sarahdayan is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updateddinero.js@​2.0.0-alpha.8 ⏵ 2.0.0100 +110084 +291 +11100

View full report

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