"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(module, "exports", { enumerable: true, get: ()=>_default }); const defaults = { runOnBefore: true, runOnAfter: false, runOnError: false }; const doNotWaitForEmptyEventLoopMiddleware = (opts = {})=>{ const options = { ...defaults, ...opts }; const doNotWaitForEmptyEventLoop = async (request)=>{ request.context.callbackWaitsForEmptyEventLoop = false; }; return { before: options.runOnBefore ? doNotWaitForEmptyEventLoop : undefined, after: options.runOnAfter ? doNotWaitForEmptyEventLoop : undefined, onError: options.runOnError ? doNotWaitForEmptyEventLoop : undefined }; }; const _default = doNotWaitForEmptyEventLoopMiddleware; //# sourceMappingURL=index.cjs.map