@inquirer/testing 2.1.41 → 2.1.42

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/README.md CHANGED
@@ -6,10 +6,12 @@ The `@inquirer/testing` package is Inquirer's answer to testing prompts [built w
6
6
 
7
7
  <div align="center" markdown="1">
8
8
 
9
- [![Warp](https://github.com/user-attachments/assets/2bda420d-4211-4900-a37e-e3c7056d799c)](https://www.warp.dev/?utm_source=npmjs&utm_medium=referral&utm_campaign=inquirer)<br>
10
- **[Warp, the intelligent terminal for developers](https://www.warp.dev/?utm_source=npmjs&utm_medium=referral&utm_campaign=inquirer)**<br>
9
+ [![Warp](https://github.com/user-attachments/assets/0c3b132c-8984-49cf-918a-db6f6abe2c01)](https://www.warp.dev/?utm_source=npmjs&utm_medium=referral&utm_campaign=inquirer)<br>
10
+
11
+ ### [Warp, the intelligent terminal for developers](https://www.warp.dev/?utm_source=npmjs&utm_medium=referral&utm_campaign=inquirer)
12
+
13
+ [Inquirer's terminal of choice!](https://www.warp.dev/?utm_source=npmjs&utm_medium=referral&utm_campaign=inquirer)<br>
11
14
  [Available for MacOS and Linux](https://www.warp.dev/?utm_source=npmjs&utm_medium=referral&utm_campaign=inquirer)<br>
12
- [Visit warp.dev to learn more](https://www.warp.dev/?utm_source=npmjs&utm_medium=referral&utm_campaign=inquirer)
13
15
 
14
16
  </div>
15
17
 
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.render = render;
7
7
  const node_stream_1 = require("node:stream");
8
+ const node_util_1 = require("node:util");
8
9
  const mute_stream_1 = __importDefault(require("mute-stream"));
9
- const strip_ansi_1 = __importDefault(require("strip-ansi"));
10
10
  const ansi_escapes_1 = __importDefault(require("ansi-escapes"));
11
11
  const ignoredAnsi = new Set([ansi_escapes_1.default.cursorHide, ansi_escapes_1.default.cursorShow]);
12
12
  class BufferedStream extends node_stream_1.Stream.Writable {
@@ -24,7 +24,7 @@ class BufferedStream extends node_stream_1.Stream.Writable {
24
24
  // Stripping the ANSI codes here because Inquirer will push commands ANSI (like cursor move.)
25
25
  // This is probably fine since we don't care about those for testing; but this could become
26
26
  // an issue if we ever want to test for those.
27
- if ((0, strip_ansi_1.default)(str).trim().length > 0) {
27
+ if ((0, node_util_1.stripVTControlCharacters)(str).trim().length > 0) {
28
28
  this.#_chunks.push(str);
29
29
  }
30
30
  callback();
@@ -68,7 +68,7 @@ async function render(prompt, props, options) {
68
68
  events,
69
69
  getScreen: ({ raw } = {}) => {
70
70
  const lastScreen = output.getLastChunk({ raw });
71
- return raw ? lastScreen : (0, strip_ansi_1.default)(lastScreen).trim();
71
+ return raw ? lastScreen : (0, node_util_1.stripVTControlCharacters)(lastScreen).trim();
72
72
  },
73
73
  getFullOutput: () => {
74
74
  return output.getFullOutput();
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Stream } from 'node:stream';
2
+ import { stripVTControlCharacters } from 'node:util';
2
3
  import MuteStream from 'mute-stream';
3
- import stripAnsi from 'strip-ansi';
4
4
  import ansiEscapes from 'ansi-escapes';
5
5
  const ignoredAnsi = new Set([ansiEscapes.cursorHide, ansiEscapes.cursorShow]);
6
6
  class BufferedStream extends Stream.Writable {
@@ -18,7 +18,7 @@ class BufferedStream extends Stream.Writable {
18
18
  // Stripping the ANSI codes here because Inquirer will push commands ANSI (like cursor move.)
19
19
  // This is probably fine since we don't care about those for testing; but this could become
20
20
  // an issue if we ever want to test for those.
21
- if (stripAnsi(str).trim().length > 0) {
21
+ if (stripVTControlCharacters(str).trim().length > 0) {
22
22
  this.#_chunks.push(str);
23
23
  }
24
24
  callback();
@@ -62,7 +62,7 @@ export async function render(prompt, props, options) {
62
62
  events,
63
63
  getScreen: ({ raw } = {}) => {
64
64
  const lastScreen = output.getLastChunk({ raw });
65
- return raw ? lastScreen : stripAnsi(lastScreen).trim();
65
+ return raw ? lastScreen : stripVTControlCharacters(lastScreen).trim();
66
66
  },
67
67
  getFullOutput: () => {
68
68
  return output.getFullOutput();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/testing",
3
- "version": "2.1.41",
3
+ "version": "2.1.42",
4
4
  "description": "Inquirer testing utilities",
5
5
  "keywords": [
6
6
  "answer",
@@ -77,16 +77,15 @@
77
77
  "tsc": "tshy"
78
78
  },
79
79
  "dependencies": {
80
- "@inquirer/type": "^3.0.2",
80
+ "@inquirer/type": "^3.0.3",
81
81
  "ansi-escapes": "^4.3.2",
82
- "mute-stream": "^2.0.0",
83
- "strip-ansi": "^6.0.1"
82
+ "mute-stream": "^2.0.0"
84
83
  },
85
84
  "devDependencies": {
86
- "@arethetypeswrong/cli": "^0.17.2",
85
+ "@arethetypeswrong/cli": "^0.17.3",
87
86
  "@repo/tsconfig": "workspace:*",
88
87
  "@types/mute-stream": "^0.0.4",
89
- "@types/node": "^22.10.5",
88
+ "@types/node": "^22.10.10",
90
89
  "tshy": "^3.0.2"
91
90
  },
92
91
  "engines": {
@@ -104,5 +103,5 @@
104
103
  "peerDependencies": {
105
104
  "@types/node": ">=18"
106
105
  },
107
- "gitHead": "0b28eff102cb90e933faf104a1e42c2298b7cb0e"
106
+ "gitHead": "a8768f9e974362aed97bc47f6c3466718e8edce9"
108
107
  }