@rotorsoft/act 1.14.1 → 1.15.0
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/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +34 -15
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-config.d.ts +44 -11
- package/dist/@types/internal/autoclose-config.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-cycle.d.ts +11 -6
- package/dist/@types/internal/autoclose-cycle.d.ts.map +1 -1
- package/dist/@types/internal/close-cycle.d.ts +14 -0
- package/dist/@types/internal/close-cycle.d.ts.map +1 -1
- package/dist/@types/internal/index.d.ts +1 -1
- package/dist/@types/internal/index.d.ts.map +1 -1
- package/dist/@types/types/ports.d.ts +49 -0
- package/dist/@types/types/ports.d.ts.map +1 -1
- package/dist/{chunk-QKVY5QAQ.js → chunk-DBQT3ALY.js} +21 -2
- package/dist/{chunk-QKVY5QAQ.js.map → chunk-DBQT3ALY.js.map} +1 -1
- package/dist/index.cjs +131 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +111 -63
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +20 -1
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +1 -1
- package/package.json +2 -2
package/dist/test/index.cjs
CHANGED
|
@@ -4854,8 +4854,18 @@ var InMemoryStore = class {
|
|
|
4854
4854
|
const limit = query?.limit ?? 100;
|
|
4855
4855
|
const after = query?.after;
|
|
4856
4856
|
const blocked = query?.blocked;
|
|
4857
|
+
const source_matches = query?.source_matches;
|
|
4857
4858
|
const stream_re = query?.stream && !query.stream_exact ? new RegExp(query.stream) : void 0;
|
|
4858
4859
|
const source_re = query?.source && !query.source_exact ? new RegExp(query.source) : void 0;
|
|
4860
|
+
const reverse_cache = /* @__PURE__ */ new Map();
|
|
4861
|
+
const reverse_match = (source) => {
|
|
4862
|
+
let re = reverse_cache.get(source);
|
|
4863
|
+
if (!re) {
|
|
4864
|
+
re = new RegExp(source);
|
|
4865
|
+
reverse_cache.set(source, re);
|
|
4866
|
+
}
|
|
4867
|
+
return source_matches.some((name) => re.test(name));
|
|
4868
|
+
};
|
|
4859
4869
|
const sorted = [...this._streams.values()].sort(
|
|
4860
4870
|
(a, b2) => a.stream.localeCompare(b2.stream)
|
|
4861
4871
|
);
|
|
@@ -4871,6 +4881,9 @@ var InMemoryStore = class {
|
|
|
4871
4881
|
if (query.source_exact ? s.source !== query.source : !source_re.test(s.source))
|
|
4872
4882
|
continue;
|
|
4873
4883
|
}
|
|
4884
|
+
if (source_matches !== void 0) {
|
|
4885
|
+
if (s.source && !reverse_match(s.source)) continue;
|
|
4886
|
+
}
|
|
4874
4887
|
if (blocked !== void 0 && s.blocked !== blocked) continue;
|
|
4875
4888
|
if (query?.lane !== void 0 && s.lane !== query.lane) continue;
|
|
4876
4889
|
callback({
|
|
@@ -4913,6 +4926,8 @@ var InMemoryStore = class {
|
|
|
4913
4926
|
const want_count = options?.count ?? false;
|
|
4914
4927
|
const want_names = options?.names ?? false;
|
|
4915
4928
|
const before = options?.before;
|
|
4929
|
+
const after = options?.after;
|
|
4930
|
+
const limit = options?.limit;
|
|
4916
4931
|
const array_targets = Array.isArray(input) ? new Set(input) : null;
|
|
4917
4932
|
const filter = Array.isArray(input) ? null : input;
|
|
4918
4933
|
const stream_re = filter?.stream && !filter.stream_exact ? new RegExp(filter.stream) : void 0;
|
|
@@ -4951,13 +4966,17 @@ var InMemoryStore = class {
|
|
|
4951
4966
|
a.names[n] = (a.names[n] ?? 0) + 1;
|
|
4952
4967
|
}
|
|
4953
4968
|
}
|
|
4969
|
+
const ordered = [...acc.keys()].sort((x, y2) => x.localeCompare(y2));
|
|
4954
4970
|
const out = /* @__PURE__ */ new Map();
|
|
4955
|
-
for (const
|
|
4971
|
+
for (const stream of ordered) {
|
|
4972
|
+
if (after !== void 0 && stream <= after) continue;
|
|
4973
|
+
const a = acc.get(stream);
|
|
4956
4974
|
const stats = { head: a.head };
|
|
4957
4975
|
if (want_tail) stats.tail = a.tail;
|
|
4958
4976
|
if (want_count) stats.count = a.count;
|
|
4959
4977
|
if (want_names) stats.names = a.names;
|
|
4960
4978
|
out.set(stream, stats);
|
|
4979
|
+
if (limit !== void 0 && out.size >= limit) break;
|
|
4961
4980
|
}
|
|
4962
4981
|
return out;
|
|
4963
4982
|
}
|