aneka 0.17.1 → 0.17.3

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/CHANGES.md CHANGED
@@ -5,6 +5,7 @@
5
5
  - [0.17.0] Add `setTimeout()`
6
6
  - [0.17.0] Add `setInterval()`
7
7
  - [0.17.1] Add `runFirst` option to `setInterval()`
8
+ - [0.17.2] Drop `runFirst` option from `setInterval()`
8
9
 
9
10
  ## 2026-07-01
10
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aneka",
3
- "version": "0.17.1",
3
+ "version": "0.17.3",
4
4
  "description": "Some usefull function helper for daily use",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,11 +18,10 @@ import parseDuration from './parse-duration.js'
18
18
  * @param {boolean} [options.silent=true] If true, errors during lock acquisition will be ignored.
19
19
  * @param {number} [options.maxIterations=Infinity] Maximum number of times to execute the handler.
20
20
  * @param {Object} [options.scope] The scope to bind the handler to.
21
- * @param {boolean} [options.runFirst=false] If true, the handler will be executed immediately before the first interval.
22
21
  * @returns {Promise<void>} Promise resolved after the interval.
23
22
  */
24
23
  async function setInterval (handler, timeout, options = {}) {
25
- const { lockFile, args = [], lockFileOpts, silent = true, maxIterations = Infinity, scope, runFirst } = options
24
+ const { lockFile, args = [], lockFileOpts, silent = true, maxIterations = Infinity, scope } = options
26
25
  timeout = parseDuration(timeout)
27
26
  let iterations = 0
28
27
 
@@ -47,7 +46,6 @@ async function setInterval (handler, timeout, options = {}) {
47
46
  setTimeout(exec, timeout)
48
47
  }
49
48
 
50
- if (runFirst) await execHandler()
51
49
  exec()
52
50
  }
53
51
 
@@ -76,16 +76,6 @@ describe('setInterval', function () {
76
76
  expect(timers.queue).to.have.length(0)
77
77
  })
78
78
 
79
- it('runs the handler immediately when runFirst is true', async function () {
80
- const timers = installTimerQueue()
81
- const calls = []
82
-
83
- await fn(() => calls.push('handler'), '1s', { runFirst: true, maxIterations: 0 })
84
-
85
- expect(calls).to.deep.equal(['handler'])
86
- expect(timers.queue).to.have.length(0)
87
- })
88
-
89
79
  it('runs the handler the requested number of times', async function () {
90
80
  const timers = installTimerQueue()
91
81
  const calls = []