Skip to content

Commit

Permalink
fix: bad checks for undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sbender9 committed Jun 6, 2024
1 parent 33fc7f2 commit 53c1ef3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions raymarine/126720.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = [
return (
n2k.description === 'Seatalk1: Display Brightness' &&
n2k.fields['Manufacturer Code'] === 'Raymarine' &&
n2k.fields['Group'] !== 'undefined'
n2k.fields['Group'] !== undefined
)
},
node: n2k => {
Expand All @@ -19,7 +19,7 @@ module.exports = [
allowNull: true,
value: n2k => {
let val = n2k.fields['Brightness']
return val !== 'undefined' ? val / 100.0 : null
return val !== undefined ? val / 100.0 : null
}
},
{
Expand All @@ -28,7 +28,7 @@ module.exports = [
return (
n2k.description === 'Seatalk1: Display Color' &&
n2k.fields['Manufacturer Code'] === 'Raymarine' &&
n2k.fields['Group'] !== 'undefined'
n2k.fields['Group'] !== undefined
)
},
node: n2k => {
Expand All @@ -47,8 +47,8 @@ module.exports = [
return (
n2k.description === 'Seatalk1: Pilot Mode' &&
n2k.fields['Manufacturer Code'] === 'Raymarine' &&
typeof n2k.fields['Pilot Mode'] !== 'undefined' &&
typeof n2k.fields['Sub Mode'] !== 'undefined'
typeof n2k.fields['Pilot Mode'] !== undefined &&
typeof n2k.fields['Sub Mode'] !== undefined
)
},
node: 'steering.autopilot.state',
Expand Down

0 comments on commit 53c1ef3

Please sign in to comment.