Skip to content

Commit 32b2869

Browse files
committed
cleanup
1 parent 22f329e commit 32b2869

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/normalizeBenchmarkResult.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { extractRangeInfo } from './extractRangeInfo';
44

55
export function normalizeBenchmarkResult(
66
prevBenchResult: BenchmarkResult | undefined | null,
7-
currenBenchResult: BenchmarkResult,
7+
currentBenchResult: BenchmarkResult,
88
): BenchmarkResult {
99
if (!prevBenchResult) {
10-
return currenBenchResult;
10+
return currentBenchResult;
1111
}
1212

1313
const prevUnit = prevBenchResult.unit;
14-
const currentUnit = currenBenchResult.unit;
15-
const currentRange = currenBenchResult.range;
14+
const currentUnit = currentBenchResult.unit;
15+
const currentRange = currentBenchResult.range;
1616
const currentRangeInfo = extractRangeInfo(currentRange);
1717

18-
const normalizedValue = normalizeValueByUnit(prevUnit, currentUnit, currenBenchResult.value);
19-
const normalizedUnit = currenBenchResult.value !== normalizedValue ? prevUnit : currentUnit;
18+
const normalizedValue = normalizeValueByUnit(prevUnit, currentUnit, currentBenchResult.value);
19+
const normalizedUnit = currentBenchResult.value !== normalizedValue ? prevUnit : currentUnit;
2020
const normalizedRangeInfo = currentRangeInfo
2121
? {
2222
prefix: currentRangeInfo.prefix,
@@ -25,7 +25,7 @@ export function normalizeBenchmarkResult(
2525
: undefined;
2626

2727
return {
28-
...currenBenchResult,
28+
...currentBenchResult,
2929
value: normalizedValue,
3030
unit: normalizedUnit,
3131
range: normalizedRangeInfo ? `${normalizedRangeInfo.prefix}${normalizedRangeInfo.value}` : currentRange,

src/normalizeValueByUnit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { canonicalizeUnit } from './canonicalizeUnit';
22

33
export function normalizeValueByUnit(prevUnit: string, currentUnit: string, value: number): number {
4+
const prev = canonicalizeUnit(prevUnit);
5+
const current = canonicalizeUnit(currentUnit);
46
for (const units of SUPPORTED_UNITS) {
5-
const prev = canonicalizeUnit(prevUnit);
6-
const current = canonicalizeUnit(currentUnit);
77
const prevUnitIndex = units.indexOf(prev);
88
const currentUnitIndex = units.indexOf(current);
99

0 commit comments

Comments
 (0)