Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

knx-listener

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knx-listener - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

dist/constants.d.ts

@@ -36,3 +36,3 @@ export declare const enum Service {

}
export declare const MyIp: any;
export declare const MyIp: string;
export declare const MyIpNumber: number;

@@ -5,3 +5,3 @@ export declare function ip2num(ipString: string): number;

export declare function mac2num(macString: string): number;
export declare function getCurrentIp(): any;
export declare function getCurrentIp(): string;
export declare function sizeOf(value: number): number;

@@ -8,0 +8,0 @@ export declare function knxAddr2num(addrStr: string): number;

@@ -27,9 +27,11 @@ "use strict";

function getCurrentIp() {
let address;
const ifaces = os_1.networkInterfaces();
for (const dev in ifaces) {
ifaces[dev].filter((details) => details.family === 'IPv4' && details.internal === false ?
address = details.address : undefined);
for (const details of ifaces[dev]) {
if (details.family === 'IPv4' && details.internal === false) {
return details.address;
}
}
}
return address;
throw new Error('Failed to get current ip');
}

@@ -72,2 +74,3 @@ exports.getCurrentIp = getCurrentIp;

exports.isKnxAddress = isKnxAddress;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDJCQUF1QztBQUV2QyxnQkFBdUIsUUFBZ0I7SUFDckMsTUFBTSxRQUFRLEdBQUcsUUFBUSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUNyQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxHQUFHLENBQUMsR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RyTnVtID4+IDgpICYgMHg3IDogKGFkZHJOdW0gPj4gOCkgJiAweGYsXG4gICAgKGFkZHJOdW0gJiAweGZmKV0uam9pbihpc0dyb3VwQWRkciA/ICcvJyA6ICcuJyk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiByZW1vdmVOb25QcmludGFibGUoc3RyOiBzdHJpbmcpIHtcbiAgcmV0dXJuIHN0ci5yZXBsYWNlKC9bXlxceDIwLVxceDdFXSsvZywgJycpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gbm9vcCguLi5fOiBhbnlbXSkgeyB9XG5cbmV4cG9ydCBmdW5jdGlvbiBpc0lQdjQoaXBTdHI6IHN0cmluZykge1xuICByZXR1cm4gLygyNVswLTVdfDJbMC00XVswLTldfFswMV0/WzAtOV1bMC05XT8pXFwuKDI1WzAtNV18MlswLTRdWzAtOV18WzAxXT9bMC05XVswLTldPylcXC4oMjVbMC01XXwyWzAtNF1bMC05XXxbMDFdP1swLTldWzAtOV0/KVxcLigyNVswLTVdfDJbMC00XVswLTldfFswMV0/WzAtOV1bMC05XT8pL1xuICAgIC50ZXN0KGlwU3RyKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzS254QWRkcmVzcyhrbnhTdHJBZGRyOiBzdHJpbmcpIHtcbiAgcmV0dXJuIGtueFN0ckFkZHIuc3BsaXQoL1tcXC5cXC9dLyk7XG59XG4iXX0=
console.log(getCurrentIp());
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDJCQUF1QztBQUV2QyxnQkFBdUIsUUFBZ0I7SUFDckMsTUFBTSxRQUFRLEdBQUcsUUFBUSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUNyQyxNQUFNLENBQ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knx-listener",
"license": "MIT",
"version": "0.0.5",
"version": "0.0.6",
"main": "./dist/index.js",

@@ -6,0 +6,0 @@ "types": "./dist/index.d.ts",

@@ -27,10 +27,11 @@ import { networkInterfaces } from 'os';

export function getCurrentIp() {
let address;
const ifaces = networkInterfaces();
for (const dev in ifaces) {
ifaces[dev].filter((details) =>
details.family === 'IPv4' && details.internal === false ?
address = details.address : undefined);
for (const details of ifaces[dev]) {
if (details.family === 'IPv4' && details.internal === false) {
return details.address;
}
}
}
return address;
throw new Error('Failed to get current ip');
}

@@ -37,0 +38,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc