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

hap-nodejs

Package Overview
Dependencies
Maintainers
10
Versions
550
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hap-nodejs - npm Package Compare versions

Comparing version 1.1.1-alpha.6 to 1.1.1-alpha.7

26

dist/lib/Advertiser.js

@@ -198,15 +198,18 @@ import assert from 'node:assert';

function messageBusConnectionResult(bus) {
debug('messageBusConnectionResult(): Checking DBus connection...');
return new Promise((resolve, reject) => {
const errorHandler = (error) => {
bus.connection.removeListener('connect', () => {
bus.connection.removeListener('error', errorHandler);
resolve();
});
debug('messageBusConnectionResult(): DBus connection failed!');
// eslint-disable-next-line ts/no-use-before-define
bus.connection.removeListener('connect', connectHandler);
reject(error);
};
bus.connection.once('connect', () => {
const connectHandler = () => {
debug('messageBusConnectionResult(): DBus connection established!');
bus.connection.removeListener('error', errorHandler);
resolve();
});
};
bus.connection.once('connect', connectHandler);
bus.connection.once('error', errorHandler);
debug('messageBusConnectionResult(): DBus connection!');
});

@@ -234,2 +237,3 @@ }

return new Promise((resolve, reject) => {
debug('dbusInvoke(): Invoking DBus method %s.%s on %s at %s', dbusInterface, member, destination, path);
const command = {

@@ -244,4 +248,8 @@ destination,

.invoke(command)
.then(result => resolve(result))
.then((result) => {
debug('dbusInvoke(): DBus method %s.%s on %s at %s succeeded: %o', dbusInterface, member, destination, path, result);
resolve(result);
})
.catch((error) => {
debug('dbusInvoke(): DBus method %s.%s on %s at %s failed: %s', dbusInterface, member, destination, path, error);
reject(new DBusInvokeError(error));

@@ -402,3 +410,5 @@ });

try {
debug('Checking Avahi/DBus connection...');
await messageBusConnectionResult(bus);
debug('Avahi/DBus connection established!');
}

@@ -410,2 +420,3 @@ catch (error) {

try {
debug('Checking Avahi/DBus interface...');
const version = await this.avahiInvoke(bus, '/', 'Server', 'GetVersionString');

@@ -418,2 +429,3 @@ debug('Detected Avahi over DBus interface running version \'%s\'.', version);

}
debug('Avahi/DBus classified available!');
return true;

@@ -420,0 +432,0 @@ }

{
"name": "hap-nodejs",
"type": "module",
"version": "1.1.1-alpha.6",
"version": "1.1.1-alpha.7",
"description": "HAP-NodeJS is a Node.js implementation of HomeKit Accessory Server.",

@@ -6,0 +6,0 @@ "author": "Khaos Tian <khaos.tian@gmail.com> (https://tz.is/)",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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