Skip to content

Commit

Permalink
refactor: cleanup variables namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
jerome-benoit committed Sep 29, 2024
1 parent 551df36 commit f84c010
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
checkBenchmarkArgs,
colors,
convertReportToBmf,
cpu,
cpuModel,
gc,
measure,
mergeDeepRight,
Expand Down Expand Up @@ -300,7 +300,7 @@ export async function run(opts = {}) {

const report = {
benchmarks,
cpu,
cpu: `${cpuModel}`,
runtime: `${runtime} ${version} (${os})`,
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const os = (() => {
}[runtime]()
})()

export const cpu = await (async () => {
export const cpuModel = await (async () => {
return await {
unknown: () => 'unknown',
browser: () => 'unknown',
Expand Down Expand Up @@ -174,9 +174,9 @@ export const checkBenchmarkArgs = (fn, opts = {}) => {
}

export const overrideBenchmarkDefaults = (benchmark, opts) => {
benchmark.samples = opts.samples ?? benchmark.samples
benchmark.time = opts.time ?? benchmark.time
benchmark.warmup = opts.warmup ?? benchmark.warmup
benchmark.samples ??= opts.samples
benchmark.time ??= opts.time
benchmark.warmup ??= opts.warmup
}

export const mergeDeepRight = (target, source) => {
Expand Down

0 comments on commit f84c010

Please sign in to comment.