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

@lion/localize

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lion/localize - npm Package Compare versions

Comparing version 0.14.5 to 0.14.6

8

CHANGELOG.md
# Change Log
## 0.14.6
### Patch Changes
- 7682e520: Fix formatting negative values for Turkish locale.
- Updated dependencies [e92b98a4]
- @lion/core@0.13.1
## 0.14.5

@@ -4,0 +12,0 @@

10

package.json
{
"name": "@lion/localize",
"version": "0.14.5",
"version": "0.14.6",
"description": "The localization system helps to manage localization data split into locales and automate its loading",

@@ -26,5 +26,7 @@ "license": "MIT",

"scripts": {
"debug": "cd ../../ && yarn debug --group localize",
"debug:firefox": "cd ../../ && yarn debug:firefox --group localize",
"debug:webkit": "cd ../../ && yarn debug:webkit --group localize",
"prepublishOnly": "../../scripts/npm-prepublish.js",
"test": "cd ../../ && yarn test:browser --grep \"packages/localize/test/**/*.test.js\"",
"test:watch": "cd ../../ && yarn test:browser:watch --grep \"packages/localize/test/**/*.test.js\""
"test": "cd ../../ && yarn test:browser --group localize"
},

@@ -34,3 +36,3 @@ "sideEffects": false,

"@bundled-es-modules/message-format": "6.0.4",
"@lion/core": "0.13.0",
"@lion/core": "0.13.1",
"singleton-manager": "1.1.2"

@@ -37,0 +39,0 @@ },

12

src/number/forceTryCurrencyCode.js

@@ -7,11 +7,15 @@ /**

*/
export function forceTryCurrencyCode(formattedParts, { currency, currencyDisplay } = {}) {
const result = formattedParts;
// Change the currency code from TRY to TL, for Turkey
if (currency === 'TRY' && currencyDisplay === 'code') {
if (result[0].value === 'TRY') {
result[0].value = 'TL';
}
result.map(part => {
const newPart = part;
if (part.type === 'currency') {
newPart.value = 'TL';
}
return newPart;
});
}
return result;
}

@@ -332,4 +332,14 @@ import { expect } from '@open-wc/testing';

});
it('forces turkish currency code ', () => {
localize.locale = 'tr-TR';
expect(
formatNumber(1234.56, { style: 'currency', currencyDisplay: 'code', currency: 'TRY' }),
).to.equal('1.234,56 TL');
expect(
formatNumber(-1234.56, { style: 'currency', currencyDisplay: 'code', currency: 'TRY' }),
).to.equal('−1.234,56 TL');
});
});
});
});
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