@mathigon/fermat
Advanced tools
Comparing version 1.1.21 to 1.1.22
@@ -1072,13 +1072,10 @@ "use strict"; | ||
for (const v of values) { | ||
if (!counts.has(v)) { | ||
counts.set(v, 1); | ||
} else { | ||
const newCount = counts.get(v) + 1; | ||
counts.set(v, newCount); | ||
if (newCount === maxCount) { | ||
result = void 0; | ||
} else if (newCount > maxCount) { | ||
maxCount = newCount; | ||
result = v; | ||
} | ||
if (!counts.has(v)) counts.set(v, 0); | ||
const newCount = counts.get(v) + 1; | ||
counts.set(v, newCount); | ||
if (newCount === maxCount) { | ||
result = void 0; | ||
} else if (newCount > maxCount) { | ||
maxCount = newCount; | ||
result = v; | ||
} | ||
@@ -1085,0 +1082,0 @@ } |
@@ -1006,13 +1006,10 @@ var __defProp = Object.defineProperty; | ||
for (const v of values) { | ||
if (!counts.has(v)) { | ||
counts.set(v, 1); | ||
} else { | ||
const newCount = counts.get(v) + 1; | ||
counts.set(v, newCount); | ||
if (newCount === maxCount) { | ||
result = void 0; | ||
} else if (newCount > maxCount) { | ||
maxCount = newCount; | ||
result = v; | ||
} | ||
if (!counts.has(v)) counts.set(v, 0); | ||
const newCount = counts.get(v) + 1; | ||
counts.set(v, newCount); | ||
if (newCount === maxCount) { | ||
result = void 0; | ||
} else if (newCount > maxCount) { | ||
maxCount = newCount; | ||
result = v; | ||
} | ||
@@ -1019,0 +1016,0 @@ } |
{ | ||
"name": "@mathigon/fermat", | ||
"version": "1.1.21", | ||
"version": "1.1.22", | ||
"license": "MIT", | ||
@@ -38,3 +38,3 @@ "homepage": "https://mathigon.io/fermat", | ||
"dependencies": { | ||
"@mathigon/core": "1.1.20" | ||
"@mathigon/core": "1.1.21" | ||
}, | ||
@@ -45,5 +45,5 @@ "devDependencies": { | ||
"@typescript-eslint/parser": "8.0.0", | ||
"esbuild": "0.23.1", | ||
"eslint": "8.57.0", | ||
"eslint-plugin-import": "2.30.0", | ||
"esbuild": "0.24.0", | ||
"eslint": "8.57.1", | ||
"eslint-plugin-import": "2.31.0", | ||
"tape": "5.9.0", | ||
@@ -50,0 +50,0 @@ "ts-node": "10.9.2", |
@@ -52,13 +52,10 @@ // ============================================================================ | ||
for (const v of values) { | ||
if (!counts.has(v)) { | ||
counts.set(v, 1); | ||
} else { | ||
const newCount = counts.get(v)! + 1; | ||
counts.set(v, newCount); | ||
if (newCount === maxCount) { | ||
result = undefined; | ||
} else if (newCount > maxCount) { | ||
maxCount = newCount; | ||
result = v; | ||
} | ||
if (!counts.has(v)) counts.set(v, 0); | ||
const newCount = counts.get(v)! + 1; | ||
counts.set(v, newCount); | ||
if (newCount === maxCount) { | ||
result = undefined; | ||
} else if (newCount > maxCount) { | ||
maxCount = newCount; | ||
result = v; | ||
} | ||
@@ -65,0 +62,0 @@ } |
@@ -8,5 +8,16 @@ // ============================================================================= | ||
import tape from 'tape'; | ||
import {quantile} from '../src'; | ||
import {mode, quantile} from '../src'; | ||
tape('mode', (test) => { | ||
test.equal(mode([]), undefined); | ||
test.equal(mode([2]), 2); | ||
test.equal(mode([2, 3]), undefined); | ||
test.equal(mode([2, 3, 3]), 3); | ||
test.equal(mode([2, 2, 3, 3, 4]), undefined); | ||
test.equal(mode([2, 2, 2, 3, 3, 4]), 2); | ||
test.end(); | ||
}); | ||
tape('quantile', (test) => { | ||
@@ -13,0 +24,0 @@ test.equal(quantile([], 0.5), 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
312034
+ Added@mathigon/core@1.1.21(transitive)
- Removed@mathigon/core@1.1.20(transitive)
Updated@mathigon/core@1.1.21