ble-glucose
Advanced tools
Comparing version 0.2.9 to 0.3.0
26
index.js
@@ -22,13 +22,7 @@ /* | ||
import sundial from 'sundial'; | ||
import isElectron from 'is-electron'; | ||
import bows from 'bows'; | ||
const isBrowser = typeof window !== 'undefined'; | ||
const debug = isElectron() ? bows('ble-glucose') : console.log; | ||
const debug = isBrowser ? bows('ble-glucose') : console.log; | ||
if (isElectron() || !isBrowser) { | ||
// For Node.js and Electron | ||
EventTarget = require('events'); | ||
} | ||
const options = { | ||
@@ -243,3 +237,5 @@ filters: [{ | ||
case 0x05: | ||
self.emit('numberOfRecords', this.racpObject.operand); | ||
self.dispatchEvent(new CustomEvent('numberOfRecords', { | ||
detail: this.racpObject.operand, | ||
})); | ||
break; | ||
@@ -249,9 +245,13 @@ case 0x06: | ||
debug('Success.'); | ||
self.emit('data', { | ||
records: self.records, | ||
contextRecords: self.contextRecords, | ||
}); | ||
self.dispatchEvent(new CustomEvent('data', { | ||
detail: { | ||
records: self.records, | ||
contextRecords: self.contextRecords, | ||
}, | ||
})); | ||
} else if (this.racpObject.operand === 0x0601) { | ||
// no records found | ||
self.emit('data', []); | ||
self.dispatchEvent(new CustomEvent('data', { | ||
detail: [], | ||
})); | ||
} | ||
@@ -258,0 +258,0 @@ break; |
{ | ||
"name": "ble-glucose", | ||
"version": "0.2.9", | ||
"version": "0.3.0", | ||
"description": "Reads blood glucose values from Bluetooth LE enabled meters", | ||
@@ -36,3 +36,2 @@ "main": "index.js", | ||
"core-js": "2.6.10", | ||
"is-electron": "2.2.1", | ||
"lodash": "4.17.21", | ||
@@ -39,0 +38,0 @@ "sundial": "1.6.0" |
14461
4
344
- Removedis-electron@2.2.1
- Removedis-electron@2.2.1(transitive)