mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-20 17:01:24 -07:00
* refactor: remove dead code and enable noUnusedLocals
- delete launcher/jimaku.ts and the launcher Args/config jimaku* fields
that only fed it (the SUBMINER_JIMAKU_* env vars had no effect)
- delete plugin/subminer/hover.lua; nothing has sent subminer-hover-token
since Overlay 2.0
- drop never-read anilist.characterDictionary.refreshTtlHours and
evictionPolicy (still hidden in the settings UI for old configs)
- drop unused root deps: eslint, @fontsource-variable/geist{,-mono}
(stats/ declares its own)
- delete the committed draft renderer-performance plan doc
- turn on noUnusedLocals for typecheck and remove what it surfaced,
including Windows focus-handoff values computed but never consumed
* docs(changes): add docs fragment and note retired hover messages
25 lines
886 B
TypeScript
25 lines
886 B
TypeScript
import type { LauncherYoutubeSubgenConfig } from '../types.js';
|
|
|
|
function asStringArray(value: unknown): string[] | undefined {
|
|
if (!Array.isArray(value)) return undefined;
|
|
return value.filter((entry): entry is string => typeof entry === 'string');
|
|
}
|
|
|
|
export function parseLauncherYoutubeSubgenConfig(
|
|
root: Record<string, unknown>,
|
|
): LauncherYoutubeSubgenConfig {
|
|
const youtubeRaw = root.youtube;
|
|
const youtube =
|
|
youtubeRaw && typeof youtubeRaw === 'object' ? (youtubeRaw as Record<string, unknown>) : null;
|
|
const secondarySubRaw = root.secondarySub;
|
|
const secondarySub =
|
|
secondarySubRaw && typeof secondarySubRaw === 'object'
|
|
? (secondarySubRaw as Record<string, unknown>)
|
|
: null;
|
|
|
|
return {
|
|
primarySubLanguages: asStringArray(youtube?.primarySubLanguages),
|
|
secondarySubLanguages: asStringArray(secondarySub?.secondarySubLanguages),
|
|
};
|
|
}
|