fx 34.0.0 → 35.0.0
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/index.js +7 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -272,8 +272,12 @@ async function read(fd = 0) {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
function isFile(fs, path) {
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
try {
|
|
276
|
+
const stat = fs.statSync(path, {throwIfNoEntry: false})
|
|
277
|
+
return stat !== undefined && stat.isFile()
|
|
278
|
+
} catch (err) {
|
|
279
|
+
return false
|
|
280
|
+
}
|
|
277
281
|
}
|
|
278
282
|
|
|
279
283
|
function sleepSync(ms) {
|
|
@@ -290,6 +294,7 @@ function* readLine(stdin) {
|
|
|
290
294
|
buffer += ch
|
|
291
295
|
}
|
|
292
296
|
}
|
|
297
|
+
if (buffer.length > 0) yield buffer
|
|
293
298
|
return buffer
|
|
294
299
|
}
|
|
295
300
|
|