summaryrefslogtreecommitdiff
path: root/ext/io/12_io.js
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-09 00:04:11 +1100
committerGitHub <noreply@github.com>2024-01-08 14:04:11 +0100
commit664ffe2ad0d78865668aee2c94861ff9a2421592 (patch)
treece80d8ee9bc013cb75d84bd4487ac8532158153b /ext/io/12_io.js
parentc2c115ebd8e29122ea0a1aaf041871189917e196 (diff)
chore(ext/io): cleanup unused functions (#21844)
These functions don't appear to be used anywhere.
Diffstat (limited to 'ext/io/12_io.js')
-rw-r--r--ext/io/12_io.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/ext/io/12_io.js b/ext/io/12_io.js
index 0621e6479..36cde6020 100644
--- a/ext/io/12_io.js
+++ b/ext/io/12_io.js
@@ -13,7 +13,6 @@ import {
const {
Uint8Array,
ArrayPrototypePush,
- MathMin,
TypedArrayPrototypeSubarray,
TypedArrayPrototypeSet,
TypedArrayPrototypeGetBuffer,
@@ -171,56 +170,6 @@ function concatBuffers(buffers) {
return contents;
}
-function readAllSyncSized(r, size) {
- const buf = new Uint8Array(size + 1); // 1B to detect extended files
- let cursor = 0;
-
- while (cursor < size) {
- const sliceEnd = MathMin(size + 1, cursor + READ_PER_ITER);
- const slice = TypedArrayPrototypeSubarray(buf, cursor, sliceEnd);
- const read = r.readSync(slice);
- if (typeof read == "number") {
- cursor += read;
- } else {
- break;
- }
- }
-
- // Handle truncated or extended files during read
- if (cursor > size) {
- // Read remaining and concat
- return concatBuffers([buf, readAllSync(r)]);
- } else { // cursor == size
- return TypedArrayPrototypeSubarray(buf, 0, cursor);
- }
-}
-
-async function readAllInnerSized(r, size, options) {
- const buf = new Uint8Array(size + 1); // 1B to detect extended files
- let cursor = 0;
- const signal = options?.signal ?? null;
- while (cursor < size) {
- signal?.throwIfAborted();
- const sliceEnd = MathMin(size + 1, cursor + READ_PER_ITER);
- const slice = TypedArrayPrototypeSubarray(buf, cursor, sliceEnd);
- const read = await r.read(slice);
- if (typeof read == "number") {
- cursor += read;
- } else {
- break;
- }
- }
- signal?.throwIfAborted();
-
- // Handle truncated or extended files during read
- if (cursor > size) {
- // Read remaining and concat
- return concatBuffers([buf, await readAllInner(r, options)]);
- } else {
- return TypedArrayPrototypeSubarray(buf, 0, cursor);
- }
-}
-
class Stdin {
#readable;
@@ -327,9 +276,7 @@ export {
read,
readAll,
readAllInner,
- readAllInnerSized,
readAllSync,
- readAllSyncSized,
readSync,
SeekMode,
stderr,