Skip to content

Commit

Permalink
fix(bluetooth-low-energy): interpret allowlist as strings
Browse files Browse the repository at this point in the history
For only numeric values YAML will be interpreted as number by default.
This ensures that we convert those cases to strings as well.

Closes #534
  • Loading branch information
mKeRix committed Feb 13, 2021
1 parent 36bf6b3 commit 7a442e1
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -270,7 +270,9 @@ export class BluetoothLowEnergyService

return this.config.allowlistRegex || this.config.whitelistRegex
? allowlist.some((regex) => id.match(regex))
: allowlist.map((x) => x.toLowerCase()).includes(id.toLowerCase());
: allowlist
.map((x) => String(x).toLowerCase())
.includes(id.toLowerCase());
}

/**
Expand All @@ -290,7 +292,7 @@ export class BluetoothLowEnergyService

return this.config.denylistRegex || this.config.blacklistRegex
? denylist.some((regex) => id.match(regex))
: denylist.map((x) => x.toLowerCase()).includes(id.toLowerCase());
: denylist.map((x) => String(x).toLowerCase()).includes(id.toLowerCase());
}

/**
Expand Down

0 comments on commit 7a442e1

Please sign in to comment.