From 74d53f388ab56b0af15ffe841c88db3459aefe2b Mon Sep 17 00:00:00 2001 From: LuanRT Date: Fri, 2 Sep 2022 04:45:52 -0300 Subject: [PATCH] chore: remove unused code --- src/utils/Constants.ts | 15 +-------------- src/utils/Utils.ts | 17 ----------------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index e70e4c2e..9c6c15c9 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -56,24 +56,11 @@ export const INNERTUBE_HEADERS_BASE = Object.freeze({ 'accept-encoding': 'gzip, deflate', 'content-type': 'application/json' }); -export const ACCOUNT_SETTINGS = Object.freeze({ - // Notifications - SUBSCRIPTIONS: 'NOTIFICATION_SUBSCRIPTION_NOTIFICATIONS', - RECOMMENDED_VIDEOS: 'NOTIFICATION_RECOMMENDATION_WEB_CONTROL', - CHANNEL_ACTIVITY: 'NOTIFICATION_COMMENT_WEB_CONTROL', - COMMENT_REPLIES: 'NOTIFICATION_COMMENT_REPLY_OTHER_WEB_CONTROL', - USER_MENTION: 'NOTIFICATION_USER_MENTION_WEB_CONTROL', - SHARED_CONTENT: 'NOTIFICATION_RETUBING_WEB_CONTROL', - // Privacy - PLAYLISTS_PRIVACY: 'PRIVACY_DISCOVERABLE_SAVED_PLAYLISTS', - SUBSCRIPTIONS_PRIVACY: 'PRIVACY_DISCOVERABLE_SUBSCRIPTIONS' -}); export default { URLS, OAUTH, CLIENTS, STREAM_HEADERS, - INNERTUBE_HEADERS_BASE, - ACCOUNT_SETTINGS + INNERTUBE_HEADERS_BASE }; \ No newline at end of file diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index d96dc379..685cede1 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -2,8 +2,6 @@ import package_json from '../../package.json'; import { FetchFunction } from './HTTPClient'; import userAgents from './user-agents.json'; -const VALID_CLIENTS = new Set([ 'YOUTUBE', 'YTMUSIC' ]); - export class InnertubeError extends Error { date: Date; version: string; @@ -153,21 +151,6 @@ export function timeToSeconds(time: string) { } } -/** - * Converts strings in camelCase to snake_case. - * @param string - The string in camelCase. - */ -export function camelToSnake(string: string) { - return string[0].toLowerCase() + string.slice(1, string.length).replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); -} - -/** - * Checks if a given client is valid. - */ -export function isValidClient(client: string) { - return VALID_CLIENTS.has(client); -} - /** * Throws an error if given parameters are undefined. */