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
+4 -4
View File
@@ -284,7 +284,7 @@ function ExpUtil.format_any(value, options)
end
return inspect(value, { depth = options.depth or 5, indent = "", newline = "", process = ExpUtil.safe_value })
end
return formatted
return formatted --[[@as LocalisedString]]
end
--- @alias Common.format_time_param_format "short" | "long" | "clock"
@@ -522,7 +522,7 @@ end
--- Insert a copy of the given items into the found entities. If no entities are found then they will be created if possible.
--- @param options Common.copy_items_to_surface_param
--- @return LuaEntity # The last entity inserted into
--- @return LuaEntity? # The last entity inserted into, nil if there were no items
function ExpUtil.copy_items_to_surface(options)
local entity
for item_index = 1, #options.items do
@@ -542,7 +542,7 @@ end
--- Insert a copy of the given items into the found entities. If no entities are found then they will be created if possible.
--- @param options Common.move_items_to_surface_param
--- @return LuaEntity # The last entity inserted into
--- @return LuaEntity? # The last entity inserted into, nil if there were no items
function ExpUtil.move_items_to_surface(options)
local entity
for item_index = 1, #options.items do
@@ -564,7 +564,7 @@ end
--- Move the given inventory into the found entities. If no entities are found then they will be created if possible.
--- @param options Common.transfer_inventory_to_surface_param
--- @return LuaEntity # The last entity inserted into
--- @return LuaEntity? # The last entity inserted into, nil if there were no items
function ExpUtil.transfer_inventory_to_surface(options)
options.items = options.inventory
local entity = ExpUtil.copy_items_to_surface(options)