feat(devicemanager): Introduce a UniversalDevice architecture with composable Feature system; add extensive new device/protocol support and discovery/refactors
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
* IP Range utility functions for network scanning
|
||||
*/
|
||||
|
||||
import * as os from 'os';
|
||||
|
||||
/**
|
||||
* Validates an IPv4 address
|
||||
*/
|
||||
@@ -115,7 +117,6 @@ export function cidrToIps(cidr: string): string[] {
|
||||
*/
|
||||
export function getLocalSubnet(): string | null {
|
||||
try {
|
||||
const os = require('os');
|
||||
const interfaces = os.networkInterfaces();
|
||||
|
||||
for (const name of Object.keys(interfaces)) {
|
||||
@@ -146,7 +147,7 @@ export function getLocalSubnet(): string | null {
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// os module might not be available
|
||||
// Failed to get network interfaces
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user