@inquirer/core 12.0.4 → 12.0.5

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.
@@ -10,6 +10,7 @@ import path from 'node:path';
10
10
  // Capture the real setImmediate at module load time so it works even when test
11
11
  // frameworks mock timers with vi.useFakeTimers() or similar.
12
12
  const nativeSetImmediate = globalThis.setImmediate;
13
+ const nativeClearImmediate = globalThis.clearImmediate;
13
14
  /**
14
15
  * Register an event listener and return its disposer, so registrations collapse
15
16
  * into a single statement: `cleanups.add(listenTo(rl, 'close', handler))`.
@@ -173,7 +174,8 @@ export function createPrompt(view) {
173
174
  //
174
175
  // @see https://github.com/SBoudrias/Inquirer.js/issues/1303
175
176
  if ('readableFlowing' in input) {
176
- nativeSetImmediate(startCycle);
177
+ const immediate = nativeSetImmediate(startCycle);
178
+ cleanups.add(() => nativeClearImmediate(immediate));
177
179
  }
178
180
  else {
179
181
  startCycle();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/core",
3
- "version": "12.0.4",
3
+ "version": "12.0.5",
4
4
  "description": "Core Inquirer prompt API",
5
5
  "keywords": [
6
6
  "answer",
@@ -94,5 +94,5 @@
94
94
  },
95
95
  "main": "./dist/index.js",
96
96
  "types": "./dist/index.d.ts",
97
- "gitHead": "a9436bd94d55a439df308f50e77a7cd0b2078e98"
97
+ "gitHead": "ea3130ebc609a6a3910b5397244044de7eda3d05"
98
98
  }