Files
klz-cables.com/.pnpm-store/v10/files/a0/24ce55c4a468eaf7beaf3ef448d6389477c634d130cad6d9caa9929134f3256ed2c22a64eda8e25cf2533ffffc4a445749604b7109d523369af9cc73eadff2
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

48 lines
1.2 KiB
Plaintext

import { DEBUG_BUILD } from './debug-build.js';
import { debug } from './utils/debug-logger.js';
import { isThenable } from './utils/is.js';
import { resolvedSyncPromise, rejectedSyncPromise } from './utils/syncpromise.js';
/**
* Process an array of event processors, returning the processed event (or `null` if the event was dropped).
*/
function notifyEventProcessors(
processors,
event,
hint,
index = 0,
) {
try {
const result = _notifyEventProcessors(event, hint, processors, index);
return isThenable(result) ? result : resolvedSyncPromise(result);
} catch (error) {
return rejectedSyncPromise(error);
}
}
function _notifyEventProcessors(
event,
hint,
processors,
index,
) {
const processor = processors[index];
if (!event || !processor) {
return event;
}
const result = processor({ ...event }, hint);
DEBUG_BUILD && result === null && debug.log(`Event processor "${processor.id || '?'}" dropped event`);
if (isThenable(result)) {
return result.then(final => _notifyEventProcessors(final, hint, processors, index + 1));
}
return _notifyEventProcessors(result, hint, processors, index + 1);
}
export { notifyEventProcessors };
//# sourceMappingURL=eventProcessors.js.map