refactor: partially revert ESM conversion in benchmarking code
[poolifier.git] / benchmarks / versus-external-pools / functions / function-to-bench.js
index 3009054ee68658486b737f90ca060bd207a2f2b3..74a07d1ef1ac4f410e8fada4679f1ed64d3bcac1 100644 (file)
@@ -1,11 +1,10 @@
 /**
  * The worker function to execute during pools benchmarks.
  * NOTE: This function requires to be self-contained, thread-safe and re-entrant.
- *
  * @param {*} data The worker data.
  * @returns {*} The result.
  */
-function functionToBench (data) {
+module.exports = function functionToBench (data) {
   const crypto = require('crypto')
   const fs = require('fs')
   const TaskTypes = {
@@ -48,5 +47,3 @@ function functionToBench (data) {
       throw new Error(`Unknown task type: ${data.taskType}`)
   }
 }
-
-module.exports = functionToBench