@j-o-r/sh 1.1.27 → 1.1.28
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/SH.js +2 -2
- package/package.json +1 -1
- package/types/SH.d.ts +2 -2
package/lib/SH.js
CHANGED
|
@@ -215,10 +215,10 @@ const within = async (callback) => {
|
|
|
215
215
|
*/
|
|
216
216
|
/**
|
|
217
217
|
* Read entire stdin as UTF-8. If stdin is a TTY, resolves to an empty string.
|
|
218
|
-
* @returns {Promise<string>}
|
|
218
|
+
* @returns {Promise<string|undefined>}
|
|
219
219
|
*/
|
|
220
220
|
const readIn = async () => {
|
|
221
|
-
if (process.stdin.isTTY) return
|
|
221
|
+
if (process.stdin.isTTY) return; // nothing was piped
|
|
222
222
|
let buf = '';
|
|
223
223
|
process.stdin.setEncoding('utf8');
|
|
224
224
|
for await (const chunk of process.stdin) {
|
package/package.json
CHANGED
package/types/SH.d.ts
CHANGED
|
@@ -69,9 +69,9 @@ export function retry(count: number, a: string | number | typeof expBackoff | Fu
|
|
|
69
69
|
*/
|
|
70
70
|
/**
|
|
71
71
|
* Read entire stdin as UTF-8. If stdin is a TTY, resolves to an empty string.
|
|
72
|
-
* @returns {Promise<string>}
|
|
72
|
+
* @returns {Promise<string|undefined>}
|
|
73
73
|
*/
|
|
74
|
-
export function readIn(): Promise<string>;
|
|
74
|
+
export function readIn(): Promise<string | undefined>;
|
|
75
75
|
/**
|
|
76
76
|
* Get user input from the command line (stdin)
|
|
77
77
|
* void when input has been aborted
|