From 3986ee3490206ac5ab1111f85ffe9ffe7cf0386b Mon Sep 17 00:00:00 2001 From: vybe Date: Sun, 24 May 2026 21:18:52 +0000 Subject: [PATCH] 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. --- tailscalectl/lib.js | 3 +-- tailscalectl/plugin.json | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tailscalectl/lib.js b/tailscalectl/lib.js index b27a4c3..0f93d3d 100644 --- a/tailscalectl/lib.js +++ b/tailscalectl/lib.js @@ -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; diff --git a/tailscalectl/plugin.json b/tailscalectl/plugin.json index 6f9c82f..5b8ece6 100644 --- a/tailscalectl/plugin.json +++ b/tailscalectl/plugin.json @@ -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",