From bd4bcb93d0afc4a3ab679159dd4666208cc2851f Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Fri, 25 Jun 2021 14:30:23 +0545 Subject: [PATCH] remove StreamUtils --- .eslintrc.json | 3 ++- .vscode/settings.json | 3 +++ src/index.ts | 1 - src/utils/StreamUtils.ts | 37 ------------------------------------- 4 files changed, 5 insertions(+), 39 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 src/utils/StreamUtils.ts diff --git a/.eslintrc.json b/.eslintrc.json index 05b5e82..d752175 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,6 +16,7 @@ "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/ban-ts-comment": "error", - "semi": "error" + "semi": "error", + "no-console": "error" } } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d995880 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "restructuredtext.languageServer.disabled": true +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 2e0de02..2b68008 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,6 @@ export { Playlist } from "./Structures/Playlist"; export { Player } from "./Player"; export { QueryResolver } from "./utils/QueryResolver"; export { Queue } from "./Structures/Queue"; -export { StreamUtils } from "./utils/StreamUtils"; export { Track } from "./Structures/Track"; export { Util } from "./utils/Util"; export { VoiceUtils } from "./VoiceInterface/VoiceUtils"; diff --git a/src/utils/StreamUtils.ts b/src/utils/StreamUtils.ts deleted file mode 100644 index 88b6bd2..0000000 --- a/src/utils/StreamUtils.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Duplex, Readable, PassThrough } from "stream"; - -class StreamUtils { - /** - * Stream utils - */ - constructor() { - throw new Error("Cannot instantiate static class"); - } - - /** - * Can be used to re-create used streams - * @param {Readable|Duplex} stream The used stream - * @returns {Readable} - */ - static clone(stream: Readable | Duplex): Readable { - const passed = stream.pipe(new PassThrough()); - return passed; - } - - /** - * Converts stream to buffer - * @param {Readable|Duplex} stream The stream - * @returns {Promise} - */ - static toBuffer(stream: Readable | Duplex): Promise { - return new Promise((resolve, reject) => { - const chunks: Buffer[] = []; - - stream.on("data", (chunk) => chunks.push(chunk)); - stream.on("end", () => resolve(Buffer.concat(chunks))); - stream.on("error", reject); - }); - } -} - -export { StreamUtils };