Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@depay/local-currency

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@depay/local-currency - npm Package Compare versions

Comparing version 3.2.2 to 3.3.0

7

dist/esm/index.js

@@ -439,2 +439,9 @@ var timezoneToCurrency = {

static async rate({ from, to }) {
if(to == undefined) { to = Currency.getCode(); }
let fromToUsd = await Currency.fromUSD({ amount: 1, code: from });
let toToUsd = await Currency.fromUSD({ amount: 1, code: to });
return fromToUsd.amount / toToUsd.amount
}
static async fromUSD({ amount, code, timeZone }) {

@@ -441,0 +448,0 @@ let currency = new Currency({ amount, code, timeZone });

@@ -445,2 +445,9 @@ (function (global, factory) {

static async rate({ from, to }) {
if(to == undefined) { to = Currency.getCode(); }
let fromToUsd = await Currency.fromUSD({ amount: 1, code: from });
let toToUsd = await Currency.fromUSD({ amount: 1, code: to });
return fromToUsd.amount / toToUsd.amount
}
static async fromUSD({ amount, code, timeZone }) {

@@ -447,0 +454,0 @@ let currency = new Currency({ amount, code, timeZone });

3

package.json
{
"name": "@depay/local-currency",
"moduleName": "LocalCurrency",
"version": "3.2.2",
"version": "3.3.0",
"description": "JavaScript library that detects user's local currency and provides functionalities to convert between multiple currencies.",

@@ -57,2 +57,3 @@ "main": "dist/umd/index.js",

"fetch-mock": "^9.11.0",
"jest-environment-jsdom": "^28.1.1",
"node-fetch": "^2.6.1",

@@ -59,0 +60,0 @@ "regenerator-runtime": "^0.13.7",

@@ -59,2 +59,11 @@ ## Quickstart

### rate
Gets rate for given `from` and `to`:
```javascript
let rate = await Currency.rate({ from: 'EUR', to: 'GBP' })
// 1.1585365853658536
```
### getCode

@@ -61,0 +70,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc