mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-10 02:33:04 +02:00
Carve out some dead code
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user