Skip to content

Commit

Permalink
benchmark: allow filtering with argv
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Oct 4, 2024
1 parent 3109214 commit f70a86e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions benchmark/rimrafs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ const systemRmRf = () => {
}

import { native, posix, windows } from 'rimraf'
export default {
native,
posix,
windows,
old: oldRimraf(),
system: systemRmRf(),
}
export default Object.fromEntries(
Object.entries({
native,
posix,
windows,
old: oldRimraf(),
system: systemRmRf(),
}).filter(([k]) =>
!process.argv.length || process.argv.includes(`--${k}`) ?
true
: !process.argv.includes(`--no-${k}`),
),
)

0 comments on commit f70a86e

Please sign in to comment.