homebridge-http-base
Advanced tools
Comparing version 2.0.1 to 2.0.2
/// <reference types="node" /> | ||
import EventEmitter = NodeJS.EventEmitter; | ||
import { Service } from "hap-nodejs"; | ||
import { CloseCallback, MqttClient, QoS, Packet, IConnackPacket, IClientPublishOptions, PacketCallback, IClientOptions } from "mqtt"; | ||
import { MQTTPublishObject, MQTTSubscribeObject, MQTTSubscriptionObject } from "../configparser"; | ||
import { EventEmitter } from "events"; | ||
export declare type MQTTSubscription = { | ||
@@ -7,0 +7,0 @@ topic: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var EventEmitter = NodeJS.EventEmitter; | ||
const index_1 = require("../index"); | ||
const events_1 = require("events"); | ||
const mqttClient = require('mqtt'); | ||
class MQTTClient extends EventEmitter { | ||
class MQTTClient extends events_1.EventEmitter { | ||
constructor(service, options, log, debug) { | ||
@@ -8,0 +8,0 @@ super(); |
import { Service } from "hap-nodejs"; | ||
export declare function extractValueFromPattern(pattern: RegExp, string: string, position: number): string; | ||
export declare function enumValueOf(enumObject: any, property: any, defaultValue: any): any; | ||
export declare function extractValueFromPattern(pattern: RegExp, string: string, position?: number): string; | ||
export declare function enumValueOf(enumObject: Record<string, string>, property: string | undefined, defaultValue: string): any; | ||
export declare function once(func: Function): (...args: any[]) => any; | ||
@@ -5,0 +5,0 @@ export declare function testCharacteristic(service: Service, name: string): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function extractValueFromPattern(pattern, string, position) { | ||
if (typeof position === "undefined") | ||
position = 1; // default value | ||
function extractValueFromPattern(pattern, string, position = 1) { | ||
const matchArray = string.match(pattern); | ||
@@ -7,0 +5,0 @@ if (matchArray === null) // pattern didn't match at all |
{ | ||
"name": "homebridge-http-base", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Base and utils for homebridge-http devices", | ||
@@ -5,0 +5,0 @@ "license": "ISC", |
@@ -1,2 +0,1 @@ | ||
import EventEmitter = NodeJS.EventEmitter; | ||
import {Service} from "hap-nodejs"; | ||
@@ -15,2 +14,3 @@ import { | ||
import {MQTTPublishObject, MQTTSubscribeObject, MQTTSubscriptionObject} from "../configparser"; | ||
import {EventEmitter} from "events"; | ||
const mqttClient = require('mqtt'); | ||
@@ -17,0 +17,0 @@ |
import {Service} from "hap-nodejs"; | ||
export function extractValueFromPattern(pattern: RegExp, string: string, position: number): string { | ||
if (typeof position === "undefined") | ||
position = 1; // default value | ||
export function extractValueFromPattern(pattern: RegExp, string: string, position: number = 1): string { | ||
const matchArray = string.match(pattern); | ||
@@ -17,3 +14,3 @@ | ||
export function enumValueOf(enumObject: any, property: any, defaultValue: any): any { | ||
export function enumValueOf(enumObject: Record<string, string>, property: string | undefined, defaultValue: string): any { | ||
let value = property || defaultValue; | ||
@@ -20,0 +17,0 @@ value = value.toLowerCase(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
139074
2350