@artilleryio/int-core 2.19.0-084e344 → 2.19.0-0d134b4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/engine_http.js +7 -11
  2. package/package.json +2 -2
@@ -26,7 +26,7 @@ const decompressResponse = require('decompress-response');
26
26
  const fs = require('fs');
27
27
  const path = require('path');
28
28
 
29
- const { promisify } = require('node:util');
29
+ const { promisify, callbackify } = require('node:util');
30
30
 
31
31
  const crypto = require('node:crypto');
32
32
 
@@ -222,19 +222,15 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
222
222
  return function (context, callback) {
223
223
  let processFunc = self.config.processor[requestSpec.function];
224
224
  if (processFunc) {
225
+ let f;
225
226
  if (processFunc.constructor.name === 'Function') {
226
- return processFunc(context, ee, function (hookErr) {
227
- return callback(hookErr, context);
228
- });
227
+ f = processFunc;
229
228
  } else {
230
- return processFunc(context, ee)
231
- .then(() => {
232
- callback(null, context);
233
- })
234
- .catch((err) => {
235
- callback(err, context);
236
- });
229
+ f = callbackify(processFunc);
237
230
  }
231
+ return f(context, ee, function (hookErr) {
232
+ return callback(hookErr, context);
233
+ });
238
234
  } else {
239
235
  debug(`Function "${requestSpec.function}" not defined`);
240
236
  debug('processor: %o', self.config.processor);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@artilleryio/int-core",
3
- "version": "2.19.0-084e344",
3
+ "version": "2.19.0-0d134b4",
4
4
  "main": "./index.js",
5
5
  "license": "MPL-2.0",
6
6
  "dependencies": {
7
- "@artilleryio/int-commons": "2.15.0-084e344",
7
+ "@artilleryio/int-commons": "2.15.0-0d134b4",
8
8
  "@artilleryio/sketches-js": "^2.1.1",
9
9
  "agentkeepalive": "^4.1.0",
10
10
  "arrivals": "^2.1.2",