Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
Is there a global option to enable Dinero.js strict currency format checking?

Using the latest Dinero, in the codebase I'm recently in charge with there's an absence of standard how they write 'usd'. As a result, this happens:

Dinero({
    currency: 'usd' as 'USD',
    amount: 1
}).add(Dinero({
    currency: 'USD',
    amount: 1,
}))

Throws You must provide a Dinero instance with the same currency. For Dinero, 'usd' and 'USD' aren't the same currencies it seems.

Is there a way to either make Dinero throw when a wrong currency is supplied? usd in lowercase is presumably a wrong one because in DefinitelyTyped the currency type includes only USD.

If not throw, then at least automatically convert it to uppercase.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda