@rotorsoft/act 1.14.0 → 1.14.1

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.
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  pii_strip,
46
46
  sensitive
47
47
  } from "./chunk-4TJN4G7L.js";
48
- import "./chunk-5WRI5ZAA.js";
48
+ import "./chunk-YLJ4XMA6.js";
49
49
 
50
50
  // src/signals.ts
51
51
  process.once("SIGINT", async (arg) => {
@@ -562,8 +562,17 @@ async function scan_stream_heads(streams) {
562
562
  async function partition_by_safety(stream_info, reactive_events_size, skipped) {
563
563
  if (reactive_events_size === 0) return [...stream_info.keys()];
564
564
  const pending_set = /* @__PURE__ */ new Set();
565
+ const source_regex = /* @__PURE__ */ new Map();
566
+ const get_regex = (source) => {
567
+ let re = source_regex.get(source);
568
+ if (!re) {
569
+ re = new RegExp(source);
570
+ source_regex.set(source, re);
571
+ }
572
+ return re;
573
+ };
565
574
  await store().query_streams((position) => {
566
- const source_re = position.source ? RegExp(position.source) : void 0;
575
+ const source_re = position.source ? get_regex(position.source) : void 0;
567
576
  for (const [stream, info] of stream_info) {
568
577
  if ((!source_re || source_re.test(stream)) && position.at < info.max_id) {
569
578
  pending_set.add(stream);