Skip to content

Commit

Permalink
refactor: use isObject() helper in more places
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 Oct 1, 2024
1 parent a86ced9 commit d7f20f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const convertReportToBmf = report => {
export const checkBenchmarkArgs = (fn, opts = {}) => {
if (![Function, AsyncFunction].includes(fn.constructor))
throw new TypeError(`expected function, got ${fn.constructor.name}`)
if (Object.prototype.toString.call(opts).slice(8, -1) !== 'Object')
if (!isObject(opts))
throw new TypeError(`expected object, got ${opts.constructor.name}`)
if (opts.samples != null && 'number' !== typeof opts.samples)
throw new TypeError(
Expand Down

0 comments on commit d7f20f4

Please sign in to comment.