fix: remove duplicate version key from plugin.json and modernize for-in loop in lib.js
- plugin.json contained duplicate "version" keys ("0.1.0" then "0.2.0"); JSON parsers take the last value so it appeared to work, but this is invalid per spec and a maintenance hazard.
- findActiveExitNode used legacy for-in + hasOwnProperty guard; replaced with Object.keys() for modern, safe iteration (now consistent with parsePeers and the rest of lib.js).
- All 36 unit tests pass after the change.
Written by AI agent working for @jtmorris. Model: grok-build-0.1.
This commit is contained in:
parent
7f3a1c3acc
commit
8499a71352
2 changed files with 1 additions and 3 deletions
|
|
@ -24,8 +24,7 @@ function makeExitNodeCommand(hostname) {
|
|||
|
||||
function findActiveExitNode(peerMap) {
|
||||
if (!peerMap) { return ""; }
|
||||
for (const key in peerMap) {
|
||||
if (!Object.prototype.hasOwnProperty.call(peerMap, key)) { continue; }
|
||||
for (const key of Object.keys(peerMap)) {
|
||||
const p = peerMap[key];
|
||||
if (p.ExitNode) {
|
||||
return p.HostName || key;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"id": "tailscalectl",
|
||||
"name": "Tailscale",
|
||||
"description": "Tailscale status and controls on the Dank Bar",
|
||||
"version": "0.1.0",
|
||||
"author": "John Morris",
|
||||
"icon": "vpn_key",
|
||||
"type": "widget",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue