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

i18n-number

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-number - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

22

i18n-number.js

@@ -32,2 +32,3 @@ /**

var _setupIntlPolyfillCalled = false;
var formatCache = new Map();

@@ -570,2 +571,19 @@ /**

/**
* Get a cached Intl.NumberFormat object
*
* @param {string} lang Locale for formatting.
* @param {Object} options Options for Intl.NumberFormat.
* @return {Object} Intl.NumberFormat object.
*/
_getNumberFormatObject(lang, options) {
let formatId = lang + JSON.stringify(options);
let formatObject = formatCache.get(formatId);
if (!formatObject) {
formatObject = new Intl.NumberFormat(lang, options);
formatCache.set(formatId, formatObject);
}
return formatObject;
},
/**
* Formats the number

@@ -591,3 +609,3 @@ *

}.bind(this))) {
return new Intl.NumberFormat(lang, options).format(number);
return this._getNumberFormatObject(lang, options).format(number);
}

@@ -607,3 +625,3 @@ else {

try {
return new Intl.NumberFormat(lang, options).format(number);
return this._getNumberFormatObject(lang, options).format(number);
}

@@ -610,0 +628,0 @@ catch (e) {

2

package.json

@@ -18,3 +18,3 @@ {

"name": "i18n-number",
"version": "3.0.0",
"version": "3.0.1",
"main": "i18n-number.js",

@@ -21,0 +21,0 @@ "directories": {

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