@ancon/wildcat-utils 1.44.13 → 1.44.14

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.
@@ -7,7 +7,8 @@
7
7
  * @param numIntervals Number of intervals to generate
8
8
  * @param baseSleep Base ms (first interval +/- jitter)
9
9
  * @param maxSleep Max ms (greatest allowed interval - jitter)
10
+ * @param repeatCount Number of times to repeat each interval
10
11
  * @returns Array with milliseconds entries
11
12
  */
12
- declare function generateBackoffWithEqualJitter(numIntervals?: number, baseSleep?: number, maxSleep?: number): number[];
13
+ declare function generateBackoffWithEqualJitter(numIntervals?: number, baseSleep?: number, maxSleep?: number, repeatCount?: number): number[];
13
14
  export default generateBackoffWithEqualJitter;
@@ -1 +1 @@
1
- "use strict";const a=require("../number/randomIntFromInterval.js");function i(r=1,o=500,s=3e3){const e=[];for(let t=0;t<r;t+=1){const n=Math.min(s,o*2**t),c=n/2+a(0,n/2);e.push(c)}return e}module.exports=i;
1
+ "use strict";const u=require("../number/randomIntFromInterval.js");function m(r=1,f=500,l=3e3,t=1){const n=[],o=Math.ceil(r/t);for(let e=0;e<o;e+=1){const s=Math.min(l,f*2**e),a=s/2+u(0,s/2);let c=t;e===o-1&&(c=r%t||t);for(let i=0;i<c;i+=1)n.push(a)}return n}module.exports=m;
@@ -1,12 +1,15 @@
1
- import c from "../number/randomIntFromInterval.mjs";
2
- function m(n = 1, r = 500, a = 3e3) {
3
- const e = [];
4
- for (let t = 0; t < n; t += 1) {
5
- const o = Math.min(a, r * 2 ** t), f = o / 2 + c(0, o / 2);
6
- e.push(f);
1
+ import m from "../number/randomIntFromInterval.mjs";
2
+ function p(r = 1, a = 500, c = 3e3, t = 1) {
3
+ const e = [], f = Math.ceil(r / t);
4
+ for (let o = 0; o < f; o += 1) {
5
+ const n = Math.min(c, a * 2 ** o), s = n / 2 + m(0, n / 2);
6
+ let i = t;
7
+ o === f - 1 && (i = r % t || t);
8
+ for (let l = 0; l < i; l += 1)
9
+ e.push(s);
7
10
  }
8
11
  return e;
9
12
  }
10
13
  export {
11
- m as default
14
+ p as default
12
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancon/wildcat-utils",
3
- "version": "1.44.13",
3
+ "version": "1.44.14",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",