@phensley/plurals
Advanced tools
Comparing version 1.0.6 to 1.0.7
import { Decimal } from '@phensley/decimal'; | ||
/** | ||
* Returns the number of digits in w, where w < RADIX. | ||
*/ | ||
export declare const digitCount: (w: number) => number; | ||
export declare type Operand = 'n' | 'i' | 'v' | 'w' | 'f' | 't'; | ||
@@ -3,0 +7,0 @@ /** |
/** | ||
* Returns the number of digits in w, where w < RADIX. | ||
*/ | ||
var digitCount = function (w) { | ||
export var digitCount = function (w) { | ||
if (w < 10000 /* P4 */) { | ||
@@ -6,0 +6,0 @@ if (w < 100 /* P2 */) { |
@@ -8,3 +8,2 @@ import { coerceDecimal } from '@phensley/decimal'; | ||
}; | ||
var FLAG_OTHER = (5 << 5) + 5; | ||
/** | ||
@@ -39,3 +38,3 @@ * Set of all cardinal and ordinal plural rules, and the array of expression | ||
var cat = this.ranges[((1 << s) << 5) + (1 << e)]; | ||
return CATEGORIES[cat || this.ranges[FLAG_OTHER]]; | ||
return CATEGORIES[cat] || 'other'; | ||
}; | ||
@@ -42,0 +41,0 @@ PluralRules.prototype.evaluate = function (operands, rules) { |
import { Decimal } from '@phensley/decimal'; | ||
/** | ||
* Returns the number of digits in w, where w < RADIX. | ||
*/ | ||
export declare const digitCount: (w: number) => number; | ||
export declare type Operand = 'n' | 'i' | 'v' | 'w' | 'f' | 't'; | ||
@@ -3,0 +7,0 @@ /** |
@@ -6,3 +6,3 @@ "use strict"; | ||
*/ | ||
var digitCount = function (w) { | ||
exports.digitCount = function (w) { | ||
if (w < 10000 /* P4 */) { | ||
@@ -69,3 +69,3 @@ if (w < 100 /* P2 */) { | ||
// const dec = exp < 0; | ||
var precision = (last * 7 /* RDIGITS */) + digitCount(data[last]); | ||
var precision = (last * 7 /* RDIGITS */) + exports.digitCount(data[last]); | ||
// Local operands | ||
@@ -92,3 +92,3 @@ var n = 0; | ||
var r = data[x]; | ||
var c = x !== last ? 7 /* RDIGITS */ : digitCount(r); | ||
var c = x !== last ? 7 /* RDIGITS */ : exports.digitCount(r); | ||
y = c - 1; | ||
@@ -95,0 +95,0 @@ // Scan each decimal digit of the radix number from |
@@ -10,3 +10,2 @@ "use strict"; | ||
}; | ||
var FLAG_OTHER = (5 << 5) + 5; | ||
/** | ||
@@ -41,3 +40,3 @@ * Set of all cardinal and ordinal plural rules, and the array of expression | ||
var cat = this.ranges[((1 << s) << 5) + (1 << e)]; | ||
return CATEGORIES[cat || this.ranges[FLAG_OTHER]]; | ||
return CATEGORIES[cat] || 'other'; | ||
}; | ||
@@ -44,0 +43,0 @@ PluralRules.prototype.evaluate = function (operands, rules) { |
{ | ||
"name": "@phensley/plurals", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Plural rules engine", | ||
@@ -39,3 +39,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phensley/decimal": "1.0.6", | ||
"@phensley/decimal": "1.0.7", | ||
"tslib": "1.11.1" | ||
@@ -70,3 +70,3 @@ }, | ||
}, | ||
"gitHead": "f2bf68a4be985fd349a9080b734e33fe3f19d949" | ||
"gitHead": "f411d4925d2d57589ef2cd9f1c13ef6871224bc3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
190709
2997
+ Added@phensley/decimal@1.0.7(transitive)
- Removed@phensley/decimal@1.0.6(transitive)
Updated@phensley/decimal@1.0.7