{"version":3,"file":"helpers.cjs","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["/**\n * Conditionally executes an action or clears a pending timer.\n *\n * If `canClear` returns `true`, the scheduled timer is cancelled via\n * `clearTimeout` and the action is skipped. This is the primary guard used\n * during a pause or stop to prevent buffered events from being dispatched.\n *\n * @param timer - The handle returned by `setTimeout` that may need to be cancelled.\n * @param canClear - A predicate that returns `true` when the timer should be\n *   cleared (e.g. the pausable is currently paused or stopped).\n * @param action - The callback to invoke when the timer should **not** be cleared.\n */\nexport const perform = (\n  timer: ReturnType<typeof setTimeout>,\n  canClear: () => boolean,\n  action: () => void,\n) => {\n  if (canClear()) return clearTimeout(timer);\n  action();\n};\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAa,WACX,OACA,UACA,WACG;AACH,KAAI,UAAU,CAAE,QAAO,aAAa,MAAM;AAC1C,SAAQ"}