tscommons-es-core
Advanced tools
Comparing version 1.21.1 to 1.21.2
@@ -16,2 +16,4 @@ export type TCommonsTallyEntry<K> = { | ||
enumerateArray(array: K[]): void; | ||
get size(): number; | ||
get total(): number; | ||
get(key: K): number | undefined; | ||
@@ -18,0 +20,0 @@ asMap(includeZeros?: boolean): Map<K, number>; |
@@ -42,2 +42,12 @@ export class CommonsTally { | ||
} | ||
get size() { | ||
return this.internalMap.size; | ||
} | ||
get total() { | ||
let total = 0; | ||
for (const k of this.internalMap.keys()) { | ||
total += this.internalMap.get(k); | ||
} | ||
return total; | ||
} | ||
get(key) { | ||
@@ -44,0 +54,0 @@ return this.internalMap.get(key); |
{ | ||
"name": "tscommons-es-core", | ||
"version": "1.21.1", | ||
"version": "1.21.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
614063
7623