refactor: simplify typed conversions

This commit is contained in:
Peter Steinberger
2026-04-11 01:01:25 +01:00
parent 7c02b6df84
commit ebfd468ee0
24 changed files with 42 additions and 37 deletions

View File

@@ -62,8 +62,8 @@ function stripInlineCode(text) {
const docsConfig = JSON.parse(fs.readFileSync(DOCS_JSON_PATH, "utf8"));
const redirects = new Map();
for (const item of docsConfig.redirects || []) {
const source = normalizeRoute(String(item.source || ""));
const destination = normalizeRoute(String(item.destination || ""));
const source = normalizeRoute(item.source || "");
const destination = normalizeRoute(item.destination || "");
redirects.set(source, destination);
}
@@ -414,7 +414,7 @@ export function auditDocsLinks() {
}
for (const page of collectNavPageEntries(docsConfig.navigation || [])) {
if (isGeneratedTranslatedDoc(String(page))) {
if (isGeneratedTranslatedDoc(page)) {
continue;
}
checked++;

View File

@@ -157,7 +157,7 @@ export async function collectBundledChannelConfigMetadata(params?: { repoRoot?:
const label = resolveRootLabel(source, channelId);
const description = resolveRootDescription(source, channelId);
entries.push({
pluginId: String(source.manifest.id),
pluginId: source.manifest.id,
channelId,
...(label ? { label } : {}),
...(description ? { description } : {}),

View File

@@ -61,7 +61,7 @@ if (options.field) {
if (value === undefined) {
throw new Error(`Unknown iOS version field '${options.field}'.`);
}
process.stdout.write(`${String(value)}\n`);
process.stdout.write(`${value}\n`);
process.exit(0);
}