Carve out some dead code

This commit is contained in:
Jack Kingsman
2026-02-24 18:40:35 -08:00
parent f7f696bf10
commit b1a0456a05
6 changed files with 3 additions and 143 deletions
-14
View File
@@ -25,17 +25,3 @@ export const RADIO_PRESETS: RadioPreset[] = [
{ name: 'Vietnam', freq: 920.25, bw: 250, sf: 11, cr: 5 },
];
/** Detect which preset matches the given radio parameters, or 'custom' if none match. */
export function detectPreset(freq: number, bw: number, sf: number, cr: number): string {
for (const preset of RADIO_PRESETS) {
if (preset.freq === freq && preset.bw === bw && preset.sf === sf && preset.cr === cr) {
return preset.name;
}
}
return 'custom';
}
/** Find a preset by exact name. */
export function findPreset(name: string): RadioPreset | undefined {
return RADIO_PRESETS.find((p) => p.name === name);
}
-15
View File
@@ -210,21 +210,6 @@ export function getLinkId<
};
}
export function findContactByPrefix(prefix: string, contacts: Contact[]): Contact | null {
const normalized = prefix.toLowerCase();
const matches = contacts.filter((c) => c.public_key.toLowerCase().startsWith(normalized));
return matches.length === 1 ? matches[0] : null;
}
export function findContactsByPrefix(prefix: string, contacts: Contact[]): Contact[] {
const normalized = prefix.toLowerCase();
return contacts.filter((c) => c.public_key.toLowerCase().startsWith(normalized));
}
export function findContactByName(name: string, contacts: Contact[]): Contact | null {
return contacts.find((c) => c.name === name) || null;
}
export function getNodeType(contact: Contact | null | undefined): NodeType {
return contact?.type === CONTACT_TYPE_REPEATER ? 'repeater' : 'client';
}