@gjsify/readline 0.3.12 → 0.3.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.
- package/lib/esm/index.js +635 -612
- package/lib/esm/promises.js +31 -22
- package/package.json +4 -4
package/lib/esm/promises.js
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
|
-
import { Interface as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Interface as Interface$1 } from "./index.js";
|
|
2
|
+
|
|
3
|
+
//#region src/promises.ts
|
|
4
|
+
/**
|
|
5
|
+
* Promise-based readline Interface.
|
|
6
|
+
*/
|
|
7
|
+
var Interface = class extends Interface$1 {
|
|
8
|
+
/** Ask a question and return the answer as a Promise. */
|
|
9
|
+
question(query, options) {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
super.question(query, resolve);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Create a promise-based readline Interface.
|
|
17
|
+
*/
|
|
10
18
|
function createInterface(input, output) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
if (typeof input === "object" && input !== null && !("read" in input && typeof input.read === "function")) {
|
|
20
|
+
const opts = input;
|
|
21
|
+
const rl = new Interface(opts);
|
|
22
|
+
return rl;
|
|
23
|
+
}
|
|
24
|
+
return new Interface({
|
|
25
|
+
input,
|
|
26
|
+
output
|
|
27
|
+
});
|
|
17
28
|
}
|
|
18
29
|
var promises_default = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
Interface,
|
|
24
|
-
createInterface,
|
|
25
|
-
promises_default as default
|
|
30
|
+
Interface,
|
|
31
|
+
createInterface
|
|
26
32
|
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Interface, createInterface, promises_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/readline",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Node.js readline module for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"readline"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@gjsify/events": "^0.3.
|
|
37
|
+
"@gjsify/events": "^0.3.14"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@gjsify/cli": "^0.3.
|
|
41
|
-
"@gjsify/unit": "^0.3.
|
|
40
|
+
"@gjsify/cli": "^0.3.14",
|
|
41
|
+
"@gjsify/unit": "^0.3.14",
|
|
42
42
|
"@types/node": "^25.6.0",
|
|
43
43
|
"typescript": "^6.0.3"
|
|
44
44
|
}
|