@wrongstack/plugin-sdk 1.0.6 → 1.0.8
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.
|
@@ -54,6 +54,12 @@ export declare class BoundedMap<K, V> {
|
|
|
54
54
|
prune(): number;
|
|
55
55
|
/** Live (non-expired) entries, coldest first. */
|
|
56
56
|
entries(): IterableIterator<[K, V]>;
|
|
57
|
+
/** Live (non-expired) keys, coldest first. */
|
|
58
|
+
keys(): IterableIterator<K>;
|
|
59
|
+
/** Live (non-expired) values, coldest first. */
|
|
60
|
+
values(): IterableIterator<V>;
|
|
61
|
+
/** Execute callback for each live entry, in coldest-to-hottest order. */
|
|
62
|
+
forEach(callbackfn: (value: V, key: K, map: BoundedMap<K, V>) => void, thisArg?: unknown): void;
|
|
57
63
|
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
58
64
|
}
|
|
59
65
|
/**
|
|
@@ -81,6 +87,9 @@ export declare class BoundedSet<T> {
|
|
|
81
87
|
/** How many entries have been dropped to respect `max`, since the last clear. */
|
|
82
88
|
get evictionCount(): number;
|
|
83
89
|
values(): IterableIterator<T>;
|
|
90
|
+
keys(): IterableIterator<T>;
|
|
91
|
+
entries(): IterableIterator<[T, T]>;
|
|
92
|
+
forEach(callbackfn: (value: T, value2: T, set: BoundedSet<T>) => void, thisArg?: unknown): void;
|
|
84
93
|
[Symbol.iterator](): IterableIterator<T>;
|
|
85
94
|
}
|
|
86
95
|
//# sourceMappingURL=bounded-map.d.ts.map
|
|
@@ -93,6 +93,24 @@ var BoundedMap = class {
|
|
|
93
93
|
if (!this.expired(entry)) yield [key, entry.value];
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
/** Live (non-expired) keys, coldest first. */
|
|
97
|
+
*keys() {
|
|
98
|
+
for (const [key, entry] of this.map) {
|
|
99
|
+
if (!this.expired(entry)) yield key;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Live (non-expired) values, coldest first. */
|
|
103
|
+
*values() {
|
|
104
|
+
for (const [, entry] of this.map) {
|
|
105
|
+
if (!this.expired(entry)) yield entry.value;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** Execute callback for each live entry, in coldest-to-hottest order. */
|
|
109
|
+
forEach(callbackfn, thisArg) {
|
|
110
|
+
for (const [key, value] of this.entries()) {
|
|
111
|
+
callbackfn.call(thisArg, value, key, this);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
96
114
|
[Symbol.iterator]() {
|
|
97
115
|
return this.entries();
|
|
98
116
|
}
|
|
@@ -123,7 +141,18 @@ var BoundedSet = class {
|
|
|
123
141
|
return this.inner.evictionCount;
|
|
124
142
|
}
|
|
125
143
|
*values() {
|
|
126
|
-
for (const [key] of this.inner) yield key;
|
|
144
|
+
for (const [key] of this.inner.entries()) yield key;
|
|
145
|
+
}
|
|
146
|
+
keys() {
|
|
147
|
+
return this.values();
|
|
148
|
+
}
|
|
149
|
+
*entries() {
|
|
150
|
+
for (const [key] of this.inner.entries()) yield [key, key];
|
|
151
|
+
}
|
|
152
|
+
forEach(callbackfn, thisArg) {
|
|
153
|
+
for (const value of this.values()) {
|
|
154
|
+
callbackfn.call(thisArg, value, value, this);
|
|
155
|
+
}
|
|
127
156
|
}
|
|
128
157
|
[Symbol.iterator]() {
|
|
129
158
|
return this.values();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Worker } from "node:worker_threads";
|
|
3
3
|
var warm = null;
|
|
4
4
|
var callSeq = 0;
|
|
5
|
-
function withReDoSGuard(re, input, budgetMs =
|
|
5
|
+
function withReDoSGuard(re, input, budgetMs = 250, options = {}) {
|
|
6
6
|
const opts = { budgetMs, ...options };
|
|
7
7
|
const start = Date.now();
|
|
8
8
|
const id = ++callSeq;
|
package/dist/runtime.js
CHANGED
|
@@ -278,6 +278,24 @@ var BoundedMap = class {
|
|
|
278
278
|
if (!this.expired(entry)) yield [key, entry.value];
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
+
/** Live (non-expired) keys, coldest first. */
|
|
282
|
+
*keys() {
|
|
283
|
+
for (const [key, entry] of this.map) {
|
|
284
|
+
if (!this.expired(entry)) yield key;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/** Live (non-expired) values, coldest first. */
|
|
288
|
+
*values() {
|
|
289
|
+
for (const [, entry] of this.map) {
|
|
290
|
+
if (!this.expired(entry)) yield entry.value;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/** Execute callback for each live entry, in coldest-to-hottest order. */
|
|
294
|
+
forEach(callbackfn, thisArg) {
|
|
295
|
+
for (const [key, value] of this.entries()) {
|
|
296
|
+
callbackfn.call(thisArg, value, key, this);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
281
299
|
[Symbol.iterator]() {
|
|
282
300
|
return this.entries();
|
|
283
301
|
}
|
|
@@ -308,7 +326,18 @@ var BoundedSet = class {
|
|
|
308
326
|
return this.inner.evictionCount;
|
|
309
327
|
}
|
|
310
328
|
*values() {
|
|
311
|
-
for (const [key] of this.inner) yield key;
|
|
329
|
+
for (const [key] of this.inner.entries()) yield key;
|
|
330
|
+
}
|
|
331
|
+
keys() {
|
|
332
|
+
return this.values();
|
|
333
|
+
}
|
|
334
|
+
*entries() {
|
|
335
|
+
for (const [key] of this.inner.entries()) yield [key, key];
|
|
336
|
+
}
|
|
337
|
+
forEach(callbackfn, thisArg) {
|
|
338
|
+
for (const value of this.values()) {
|
|
339
|
+
callbackfn.call(thisArg, value, value, this);
|
|
340
|
+
}
|
|
312
341
|
}
|
|
313
342
|
[Symbol.iterator]() {
|
|
314
343
|
return this.values();
|
|
@@ -508,7 +537,7 @@ function releaseHandles(state, keys) {
|
|
|
508
537
|
import { Worker } from "node:worker_threads";
|
|
509
538
|
var warm = null;
|
|
510
539
|
var callSeq = 0;
|
|
511
|
-
function withReDoSGuard(re, input, budgetMs =
|
|
540
|
+
function withReDoSGuard(re, input, budgetMs = 250, options = {}) {
|
|
512
541
|
const opts = { budgetMs, ...options };
|
|
513
542
|
const start = Date.now();
|
|
514
543
|
const id = ++callSeq;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/plugin-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Authoring SDK for WrongStack plugins — the plugin contract types, definePlugin, and shared runtime helpers. Third-party plugins should depend on this package only.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ECOSTACK TECHNOLOGY OÜ",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"vitest": "^4.1.11"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@wrongstack/core": "1.0.
|
|
69
|
-
"@wrongstack/tools": "1.0.
|
|
68
|
+
"@wrongstack/core": "1.0.8",
|
|
69
|
+
"@wrongstack/tools": "1.0.8"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "node ../../scripts/build-package.mjs",
|