build(deps-dev): bump @types/node
[poolifier.git] / benchmarks / versus-external-pools / functions / function-to-bench.js
index 74a07d1ef1ac4f410e8fada4679f1ed64d3bcac1..ecc39a1c92be59327bd6b7d9d141c8bbf485b4be 100644 (file)
@@ -1,10 +1,11 @@
+'use strict'
 /**
- * The worker function to execute during pools benchmarks.
- * NOTE: This function requires to be self-contained, thread-safe and re-entrant.
+ * The task function to execute during pools benchmarks.
+ * NOTE: This function requires to be self-contained, thread-safe and re-entrant (node-worker-threads-pool requirement).
  * @param {*} data The worker data.
  * @returns {*} The result.
  */
-module.exports = function functionToBench (data) {
+const functionToBench = data => {
   const crypto = require('crypto')
   const fs = require('fs')
   const TaskTypes = {
@@ -47,3 +48,5 @@ module.exports = function functionToBench (data) {
       throw new Error(`Unknown task type: ${data.taskType}`)
   }
 }
+
+module.exports = functionToBench