Socket
Socket
Sign inDemoInstall

exchange-rounding

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

16

dist/index.js

@@ -87,3 +87,17 @@ class ExchNumberFormat {

this.originalCurrency = this.intlOptions.currency;
let setLocale = locales === 'auto' ? (navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language) : locales;
let setLocale;
if (locales === 'auto') {
if (typeof window !== 'undefined' && navigator.languages && navigator.languages.length) {
setLocale = navigator.languages[0];
}
else if (typeof window !== 'undefined' && navigator.language) {
setLocale = navigator.language;
}
else {
setLocale = 'en';
}
}
else {
setLocale = locales;
}
if (this.originalCurrency && this.customCurrencyData[this.originalCurrency.toUpperCase()]) {

@@ -90,0 +104,0 @@ const currencyData = this.customCurrencyData[this.originalCurrency.toUpperCase()];

2

package.json
{
"name": "exchange-rounding",
"version": "1.0.4",
"version": "1.0.5",
"description": "Exchange Number Formatting",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -105,3 +105,15 @@ interface RoundNumberOptions extends Intl.NumberFormatOptions {

// Determine the locale
let setLocale = locales === 'auto' ? (navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language) : locales;
let setLocale: string;
if (locales === 'auto') {
// Check if running in a browser environment
if (typeof window !== 'undefined' && navigator.languages && navigator.languages.length) {
setLocale = navigator.languages[0];
} else if (typeof window !== 'undefined' && navigator.language) {
setLocale = navigator.language;
} else {
setLocale = 'en'; // Default to 'en' or any other default locale
}
} else {
setLocale = locales;
}

@@ -108,0 +120,0 @@ if (this.originalCurrency && this.customCurrencyData[this.originalCurrency.toUpperCase()]) {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc