@optique/inquirer 1.0.0-dev.654 → 1.0.0-dev.655

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/index.cjs CHANGED
@@ -44,12 +44,18 @@ function promptFunctionKeys() {
44
44
  function assignPromptFunctionOverride(override, key, candidate) {
45
45
  if (typeof candidate === "function") override[key] = candidate;
46
46
  }
47
+ /**
48
+ * Extracts valid prompt function overrides from an arbitrary global value.
49
+ */
47
50
  function getPromptFunctionsOverride(value) {
48
51
  if (typeof value !== "object" || value == null) return void 0;
49
52
  const override = {};
50
53
  for (const key of promptFunctionKeys()) assignPromptFunctionOverride(override, key, Reflect.get(value, key));
51
54
  return override;
52
55
  }
56
+ /**
57
+ * Returns the active prompt function set, applying any global test overrides.
58
+ */
53
59
  function getPromptFunctions() {
54
60
  const override = getPromptFunctionsOverride(Reflect.get(globalThis, promptFunctionsOverrideSymbol));
55
61
  return override != null ? {
@@ -57,6 +63,9 @@ function getPromptFunctions() {
57
63
  ...override
58
64
  } : defaultPromptFunctions;
59
65
  }
66
+ /**
67
+ * Determines whether an error came from an interrupted Inquirer prompt.
68
+ */
60
69
  function isExitPromptError(error) {
61
70
  return typeof error === "object" && error != null && "name" in error && error.name === "ExitPromptError";
62
71
  }
package/dist/index.js CHANGED
@@ -21,12 +21,18 @@ function promptFunctionKeys() {
21
21
  function assignPromptFunctionOverride(override, key, candidate) {
22
22
  if (typeof candidate === "function") override[key] = candidate;
23
23
  }
24
+ /**
25
+ * Extracts valid prompt function overrides from an arbitrary global value.
26
+ */
24
27
  function getPromptFunctionsOverride(value) {
25
28
  if (typeof value !== "object" || value == null) return void 0;
26
29
  const override = {};
27
30
  for (const key of promptFunctionKeys()) assignPromptFunctionOverride(override, key, Reflect.get(value, key));
28
31
  return override;
29
32
  }
33
+ /**
34
+ * Returns the active prompt function set, applying any global test overrides.
35
+ */
30
36
  function getPromptFunctions() {
31
37
  const override = getPromptFunctionsOverride(Reflect.get(globalThis, promptFunctionsOverrideSymbol));
32
38
  return override != null ? {
@@ -34,6 +40,9 @@ function getPromptFunctions() {
34
40
  ...override
35
41
  } : defaultPromptFunctions;
36
42
  }
43
+ /**
44
+ * Determines whether an error came from an interrupted Inquirer prompt.
45
+ */
37
46
  function isExitPromptError(error) {
38
47
  return typeof error === "object" && error != null && "name" in error && error.name === "ExitPromptError";
39
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/inquirer",
3
- "version": "1.0.0-dev.654+c7b947a3",
3
+ "version": "1.0.0-dev.655+8548c6e8",
4
4
  "description": "Interactive prompt support for Optique via Inquirer.js",
5
5
  "keywords": [
6
6
  "CLI",
@@ -56,13 +56,13 @@
56
56
  "sideEffects": false,
57
57
  "dependencies": {
58
58
  "@inquirer/prompts": "^8.3.0",
59
- "@optique/core": "1.0.0-dev.654+c7b947a3"
59
+ "@optique/core": "1.0.0-dev.655+8548c6e8"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/node": "^20.19.9",
63
63
  "tsdown": "^0.13.0",
64
64
  "typescript": "^5.8.3",
65
- "@optique/env": "1.0.0-dev.654+c7b947a3"
65
+ "@optique/env": "1.0.0-dev.655+8548c6e8"
66
66
  },
67
67
  "scripts": {
68
68
  "build": "tsdown",