Rocky_Mountain_Vending/.pnpm-store/v10/files/23/aef3d46ec5b8f25d1dd889cd0d2a8445ece9bc1de079f5ee06eb57cb2b12c60afc9ed58e7b656f25382c9d14778bd6304a384596044c844500aca1da5aa1ac
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

38 lines
1.1 KiB
Text

import { DEBUG_BUILD } from './debug-build.js';
import { debug } from './utils/debug-logger.js';
import { isThenable } from './utils/is.js';
import { SyncPromise } 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,
) {
return new SyncPromise((resolve, reject) => {
const processor = processors[index];
if (event === null || typeof processor !== 'function') {
resolve(event);
} else {
const result = processor({ ...event }, hint) ;
DEBUG_BUILD && processor.id && result === null && debug.log(`Event processor "${processor.id}" dropped event`);
if (isThenable(result)) {
void result
.then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))
.then(null, reject);
} else {
void notifyEventProcessors(processors, result, hint, index + 1)
.then(resolve)
.then(null, reject);
}
}
});
}
export { notifyEventProcessors };
//# sourceMappingURL=eventProcessors.js.map