Switch to BiomeJS (#306)

This commit is contained in:
Gregory Schier
2025-11-23 08:38:13 -08:00
committed by GitHub
parent 2bac610efe
commit ec3e2e16a9
332 changed files with 3007 additions and 4097 deletions

View File

@@ -67,18 +67,19 @@ export function filterXPath(
result: XPathResult,
join: string | null,
): string {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// biome-ignore lint/suspicious/noExplicitAny: none
const doc: any = new DOMParser().parseFromString(body, 'text/xml');
const items = xpath.select(path, doc, false);
if (!Array.isArray(items)) {
return String(items);
} else if (!Array.isArray(items) || result === 'first') {
return items[0] != null ? String(items[0].firstChild ?? '') : '';
} else if (result === 'join') {
return items.map((item) => String(item.firstChild ?? '')).join(join ?? '');
} else {
// Not sure what cases this happens in (?)
return String(items);
}
if (!Array.isArray(items) || result === 'first') {
return items[0] != null ? String(items[0].firstChild ?? '') : '';
}
if (result === 'join') {
return items.map((item) => String(item.firstChild ?? '')).join(join ?? '');
}
// Not sure what cases this happens in (?)
return String(items);
}