@phensley/plurals
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -5,23 +5,23 @@ /** | ||
export var digitCount = function (w) { | ||
if (w < 10000 /* Constants.P4 */) { | ||
if (w < 100 /* Constants.P2 */) { | ||
return w < 10 /* Constants.P1 */ ? 1 : 2; | ||
if (w < 10000 /* P4 */) { | ||
if (w < 100 /* P2 */) { | ||
return w < 10 /* P1 */ ? 1 : 2; | ||
} | ||
return w < 1000 /* Constants.P3 */ ? 3 : 4; | ||
return w < 1000 /* P3 */ ? 3 : 4; | ||
} | ||
if (w < 1000000 /* Constants.P6 */) { | ||
return w < 100000 /* Constants.P5 */ ? 5 : 6; | ||
if (w < 1000000 /* P6 */) { | ||
return w < 100000 /* P5 */ ? 5 : 6; | ||
} | ||
return w < 10000000 /* Constants.P7 */ ? 7 : 8; | ||
return w < 10000000 /* P7 */ ? 7 : 8; | ||
}; | ||
var POWERS10 = [ | ||
1 /* Constants.P0 */, | ||
10 /* Constants.P1 */, | ||
100 /* Constants.P2 */, | ||
1000 /* Constants.P3 */, | ||
10000 /* Constants.P4 */, | ||
100000 /* Constants.P5 */, | ||
1000000 /* Constants.P6 */, | ||
10000000 /* Constants.P7 */, | ||
100000000 /* Constants.P8 */, | ||
1 /* P0 */, | ||
10 /* P1 */, | ||
100 /* P2 */, | ||
1000 /* P3 */, | ||
10000 /* P4 */, | ||
100000 /* P5 */, | ||
1000000 /* P6 */, | ||
10000000 /* P7 */, | ||
100000000 /* P8 */, | ||
]; | ||
@@ -73,3 +73,3 @@ // When a number crosses this limit we reduce it to avoid overflow. | ||
var last = len - 1; | ||
var precision = last * 7 /* Constants.RDIGITS */ + digitCount(data[last]); | ||
var precision = last * 7 /* RDIGITS */ + digitCount(data[last]); | ||
// Local operands | ||
@@ -100,3 +100,3 @@ var n = 0; | ||
var r = data[x]; | ||
var count = x !== last ? 7 /* Constants.RDIGITS */ : digitCount(r); | ||
var count = x !== last ? 7 /* RDIGITS */ : digitCount(r); | ||
y = count - 1; | ||
@@ -103,0 +103,0 @@ // Scan each decimal digit of the radix number from |
@@ -8,24 +8,24 @@ "use strict"; | ||
var digitCount = function (w) { | ||
if (w < 10000 /* Constants.P4 */) { | ||
if (w < 100 /* Constants.P2 */) { | ||
return w < 10 /* Constants.P1 */ ? 1 : 2; | ||
if (w < 10000 /* P4 */) { | ||
if (w < 100 /* P2 */) { | ||
return w < 10 /* P1 */ ? 1 : 2; | ||
} | ||
return w < 1000 /* Constants.P3 */ ? 3 : 4; | ||
return w < 1000 /* P3 */ ? 3 : 4; | ||
} | ||
if (w < 1000000 /* Constants.P6 */) { | ||
return w < 100000 /* Constants.P5 */ ? 5 : 6; | ||
if (w < 1000000 /* P6 */) { | ||
return w < 100000 /* P5 */ ? 5 : 6; | ||
} | ||
return w < 10000000 /* Constants.P7 */ ? 7 : 8; | ||
return w < 10000000 /* P7 */ ? 7 : 8; | ||
}; | ||
exports.digitCount = digitCount; | ||
var POWERS10 = [ | ||
1 /* Constants.P0 */, | ||
10 /* Constants.P1 */, | ||
100 /* Constants.P2 */, | ||
1000 /* Constants.P3 */, | ||
10000 /* Constants.P4 */, | ||
100000 /* Constants.P5 */, | ||
1000000 /* Constants.P6 */, | ||
10000000 /* Constants.P7 */, | ||
100000000 /* Constants.P8 */, | ||
1 /* P0 */, | ||
10 /* P1 */, | ||
100 /* P2 */, | ||
1000 /* P3 */, | ||
10000 /* P4 */, | ||
100000 /* P5 */, | ||
1000000 /* P6 */, | ||
10000000 /* P7 */, | ||
100000000 /* P8 */, | ||
]; | ||
@@ -77,3 +77,3 @@ // When a number crosses this limit we reduce it to avoid overflow. | ||
var last = len - 1; | ||
var precision = last * 7 /* Constants.RDIGITS */ + (0, exports.digitCount)(data[last]); | ||
var precision = last * 7 /* RDIGITS */ + (0, exports.digitCount)(data[last]); | ||
// Local operands | ||
@@ -104,3 +104,3 @@ var n = 0; | ||
var r = data[x]; | ||
var count = x !== last ? 7 /* Constants.RDIGITS */ : (0, exports.digitCount)(r); | ||
var count = x !== last ? 7 /* RDIGITS */ : (0, exports.digitCount)(r); | ||
y = count - 1; | ||
@@ -107,0 +107,0 @@ // Scan each decimal digit of the radix number from |
{ | ||
"name": "@phensley/plurals", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Plural rules engine", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phensley/decimal": "~1.6.0", | ||
"@phensley/decimal": "~1.6.1", | ||
"tslib": "^2.4.0" | ||
@@ -26,0 +26,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
258849
Updated@phensley/decimal@~1.6.1