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

@formatjs/icu-skeleton-parser

Package Overview
Dependencies
Maintainers
3
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/icu-skeleton-parser - npm Package Compare versions

Comparing version 1.2.13 to 1.3.0

17

lib/number.js

@@ -33,3 +33,3 @@ import { __assign } from "tslib";

var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;

@@ -39,2 +39,8 @@ var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;

var result = {};
if (str[str.length - 1] === 'r') {
result.roundingPriority = 'morePrecision';
}
else if (str[str.length - 1] === 's') {
result.roundingPriority = 'lessPrecision';
}
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {

@@ -266,5 +272,10 @@ // @@@ case

});
if (token.options.length) {
result = __assign(__assign({}, result), parseSignificantPrecision(token.options[0]));
var opt = token.options[0];
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
if (opt === 'w') {
result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
}
else if (opt) {
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
}
continue;

@@ -271,0 +282,0 @@ }

@@ -37,3 +37,3 @@ "use strict";

var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;

@@ -43,2 +43,8 @@ var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;

var result = {};
if (str[str.length - 1] === 'r') {
result.roundingPriority = 'morePrecision';
}
else if (str[str.length - 1] === 's') {
result.roundingPriority = 'lessPrecision';
}
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {

@@ -270,5 +276,10 @@ // @@@ case

});
if (token.options.length) {
result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(token.options[0]));
var opt = token.options[0];
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
if (opt === 'w') {
result = tslib_1.__assign(tslib_1.__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
}
else if (opt) {
result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(opt));
}
continue;

@@ -275,0 +286,0 @@ }

4

package.json
{
"name": "@formatjs/icu-skeleton-parser",
"version": "1.2.13",
"version": "1.3.0",
"main": "index.js",

@@ -9,5 +9,5 @@ "module": "lib/index.js",

"dependencies": {
"@formatjs/ecma402-abstract": "1.9.9",
"@formatjs/ecma402-abstract": "1.10.0",
"tslib": "^2.1.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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