Remove asserts the types already cover

The nil check burn down added guards which turned out redundant once
the surrounding annotations landed. `_has_handlers` is set to true when
the first handler registers, so it is a boolean rather than the literal
false it was inferred as.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:48 +00:00
co-authored by Claude Opus 5
parent f907007d14
commit 619ed4b39f
19 changed files with 68 additions and 55 deletions
+6 -3
View File
@@ -50,7 +50,8 @@ local servers = External.get_servers()
]]
function External.get_servers()
assert(ext, "No external data was found, use External.valid() to ensure external data exists.")
return (assert(ext.servers, "No server list was found, please ensure that the external service is running"))
local value = assert(ext.servers, "No server list was found, please ensure that the external service is running")
return value
end
--[[-- Gets a table of all the servers filtered by name, key is the server id, value is the server details
@@ -85,7 +86,8 @@ function External.get_current_server()
assert(ext, "No external data was found, use External.valid() to ensure external data exists.")
local servers = assert(ext.servers, "No server list was found, please ensure that the external service is running")
local server_id = assert(ext.current, "No current id was found, please ensure that the external service is running")
return (assert(servers[server_id], "No details found for server with id: " .. tostring(server_id)))
local value = assert(servers[server_id], "No details found for server with id: " .. tostring(server_id))
return value
end
--[[-- Gets the details of the given server
@@ -99,7 +101,8 @@ local server = External.get_server_details('eu-01')
function External.get_server_details(server_id)
assert(ext, "No external data was found, use External.valid() to ensure external data exists.")
local servers = assert(ext.servers, "No server list was found, please ensure that the external service is running")
return (assert(servers[server_id], "No details found for server with id: " .. tostring(server_id)))
local value = assert(servers[server_id], "No details found for server with id: " .. tostring(server_id))
return value
end
--[[-- Gets the status of the given server