webbluetooth
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -275,4 +275,6 @@ "use strict"; | ||
function getServiceUUID(service) { | ||
if (bluetoothServices[service]) | ||
// Check for string as enums also allow a reverse lookup which will match any numbers passed in | ||
if (typeof service === "string" && bluetoothServices[service]) { | ||
service = bluetoothServices[service]; | ||
} | ||
return getCanonicalUUID(service); | ||
@@ -287,4 +289,6 @@ } | ||
function getCharacteristicUUID(characteristic) { | ||
if (bluetoothCharacteristics[characteristic]) | ||
// Check for string as enums also allow a reverse lookup which will match any numbers passed in | ||
if (typeof characteristic === "string" && bluetoothCharacteristics[characteristic]) { | ||
characteristic = bluetoothCharacteristics[characteristic]; | ||
} | ||
return getCanonicalUUID(characteristic); | ||
@@ -299,4 +303,6 @@ } | ||
function getDescriptorUUID(descriptor) { | ||
if (bluetoothDescriptors[descriptor]) | ||
// Check for string as enums also allow a reverse lookup which will match any numbers passed in | ||
if (typeof descriptor === "string" && bluetoothDescriptors[descriptor]) { | ||
descriptor = bluetoothDescriptors[descriptor]; | ||
} | ||
return getCanonicalUUID(descriptor); | ||
@@ -303,0 +309,0 @@ } |
{ | ||
"name": "webbluetooth", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Node.js implementation of the Web Bluetooth Specification", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/thegecko/webbluetooth", |
@@ -271,3 +271,7 @@ /* | ||
export function getServiceUUID(service: string | number): string { | ||
if (bluetoothServices[service]) service = bluetoothServices[service]; | ||
// Check for string as enums also allow a reverse lookup which will match any numbers passed in | ||
if (typeof service === "string" && bluetoothServices[service]) { | ||
service = bluetoothServices[service]; | ||
} | ||
return getCanonicalUUID(service); | ||
@@ -282,3 +286,7 @@ } | ||
export function getCharacteristicUUID(characteristic: string | number): string { | ||
if (bluetoothCharacteristics[characteristic]) characteristic = bluetoothCharacteristics[characteristic]; | ||
// Check for string as enums also allow a reverse lookup which will match any numbers passed in | ||
if (typeof characteristic === "string" && bluetoothCharacteristics[characteristic]) { | ||
characteristic = bluetoothCharacteristics[characteristic]; | ||
} | ||
return getCanonicalUUID(characteristic); | ||
@@ -293,4 +301,8 @@ } | ||
export function getDescriptorUUID(descriptor: string | number): string { | ||
if (bluetoothDescriptors[descriptor]) descriptor = bluetoothDescriptors[descriptor]; | ||
// Check for string as enums also allow a reverse lookup which will match any numbers passed in | ||
if (typeof descriptor === "string" && bluetoothDescriptors[descriptor]) { | ||
descriptor = bluetoothDescriptors[descriptor]; | ||
} | ||
return getCanonicalUUID(descriptor); | ||
} |
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
1277649
5736