@signalk/streams 5.1.3 → 5.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/autodetect.js CHANGED
@@ -114,8 +114,11 @@ Splitter.prototype._transform = function (msg, encoding, _done) {
114
114
  try {
115
115
  const parsed = JSON.parse(msg.data)
116
116
  const timestamp = new Date(Number(msg.timestamp))
117
- parsed.updates &&
118
- parsed.updates.forEach((update) => (update.timestamp = timestamp))
117
+ if (parsed.updates) {
118
+ parsed.updates.forEach((update) => {
119
+ update.timestamp = timestamp
120
+ })
121
+ }
119
122
  this.push(parsed)
120
123
  this.demuxEmitData(parsed)
121
124
  } catch (e) {
package/n2k-signalk.js CHANGED
@@ -71,7 +71,7 @@ function ToSignalK(options) {
71
71
  })
72
72
 
73
73
  this.n2kMapper.on('n2kSourceMetadataTimeout', (pgn, src) => {
74
- if (pgn == 60928) {
74
+ if (Number(pgn) === 60928) {
75
75
  console.warn(`n2k-signalk: unable to detect can name for src ${src}`)
76
76
  this.sourceMeta[src].unknowCanName = true
77
77
  }
@@ -101,8 +101,10 @@ ToSignalK.prototype.isFiltered = function (source) {
101
101
  return (
102
102
  (!filter.source ||
103
103
  filter.source.length === 0 ||
104
- filter.source == sFilter) &&
105
- (!filter.pgn || filter.pgn.length === 0 || filter.pgn == source.pgn)
104
+ filter.source === sFilter) &&
105
+ (!filter.pgn ||
106
+ filter.pgn.length === 0 ||
107
+ String(filter.pgn) === String(source.pgn))
106
108
  )
107
109
  })
108
110
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalk/streams",
3
- "version": "5.1.3",
3
+ "version": "5.1.4",
4
4
  "description": "Utilities for handling streams of Signal K data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/simple.js CHANGED
@@ -120,7 +120,9 @@ function Simple(options) {
120
120
  transform(delta, encoding, callback) {
121
121
  if (delta.updates) {
122
122
  const now = new Date().toISOString()
123
- delta.updates.forEach((update) => (update.timestamp = now))
123
+ delta.updates.forEach((update) => {
124
+ update.timestamp = now
125
+ })
124
126
  }
125
127
  callback(null, delta)
126
128
  }