ws-cleanup-types: Types, api, host: honest annotations; return the full annotated value count
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
e35de41c9f
commit
2c15b97cd8
22 files changed
+147
-147
No files matched your search
@@ -23,19 +23,19 @@ end
|
||||
function Data.base64(text: string, compression: string?): ({ number }?, string?, boolean?)
|
||||
local raw, err = Base64.decode(text)
|
||||
if not raw then
|
||||
return nil, err
|
||||
return nil, err, nil
|
||||
end
|
||||
local bytes: buffer = raw
|
||||
if compression == "zlib" then
|
||||
local z, zerr = Deflate.zlib(bytes)
|
||||
if not z then
|
||||
return nil, "zlib: " .. tostring(zerr)
|
||||
return nil, "zlib: " .. tostring(zerr), nil
|
||||
end
|
||||
bytes = z
|
||||
elseif compression == "gzip" then
|
||||
local z, zerr = Deflate.gunzip(bytes)
|
||||
if not z then
|
||||
return nil, "gzip: " .. tostring(zerr)
|
||||
return nil, "gzip: " .. tostring(zerr), nil
|
||||
end
|
||||
bytes = z
|
||||
elseif compression ~= nil and compression ~= "" then
|
||||
|
||||
@@ -87,11 +87,11 @@ local function gids(v: any, encoding: string?, compression: string?): ({ number
|
||||
local out = {}
|
||||
for _, g in list(v) do
|
||||
if type(g) ~= "number" or g < 0 or g >= 4294967296 then
|
||||
return nil, "bad gid"
|
||||
return nil, "bad gid", nil
|
||||
end
|
||||
table.insert(out, g)
|
||||
end
|
||||
return out, nil
|
||||
return out, nil, nil
|
||||
end
|
||||
|
||||
local function object(o: any): any
|
||||
|
||||
@@ -79,7 +79,7 @@ local function gids(d: Node, encoding: string?, compression: string?): ({ number
|
||||
for _, t in Xml.children(d, "tile") do
|
||||
table.insert(out, num(t, "gid", 0) :: number)
|
||||
end
|
||||
return out, nil
|
||||
return out, nil, nil
|
||||
end
|
||||
return nil, "unknown encoding " .. encoding, true
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user