Remove unused code

This commit is contained in:
Manav Rathi 2024-03-22 19:52:08 +05:30
parent 302b9a46b5
commit 0a7991bc0e
No known key found for this signature in database
2 changed files with 0 additions and 70 deletions

View file

@ -56,38 +56,3 @@ async function* fileChunkReaderMaker(file: File, chunkSize: number) {
}
return null;
}
// depreciated
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function getUint8ArrayViewOld(
reader: FileReader,
file: Blob,
): Promise<Uint8Array> {
return await new Promise((resolve, reject) => {
reader.onabort = () =>
reject(
Error(
`file reading was aborted, file size= ${convertBytesToHumanReadable(
file.size,
)}`,
),
);
reader.onerror = () =>
reject(
Error(
`file reading has failed, file size= ${convertBytesToHumanReadable(
file.size,
)} , reason= ${reader.error}`,
),
);
reader.onload = () => {
// Do whatever you want with the file contents
const result =
typeof reader.result === "string"
? new TextEncoder().encode(reader.result)
: new Uint8Array(reader.result);
resolve(result);
};
reader.readAsArrayBuffer(file);
});
}

View file

@ -56,38 +56,3 @@ async function* fileChunkReaderMaker(file: File, chunkSize: number) {
}
return null;
}
// depreciated
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function getUint8ArrayViewOld(
reader: FileReader,
file: Blob,
): Promise<Uint8Array> {
return await new Promise((resolve, reject) => {
reader.onabort = () =>
reject(
Error(
`file reading was aborted, file size= ${convertBytesToHumanReadable(
file.size,
)}`,
),
);
reader.onerror = () =>
reject(
Error(
`file reading has failed, file size= ${convertBytesToHumanReadable(
file.size,
)} , reason= ${reader.error}`,
),
);
reader.onload = () => {
// Do whatever you want with the file contents
const result =
typeof reader.result === "string"
? new TextEncoder().encode(reader.result)
: new Uint8Array(reader.result);
resolve(result);
};
reader.readAsArrayBuffer(file);
});
}