mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 20:21:38 +00:00
Merge branch 'master' of https://github.com/boatbomber/rojo into headless-api
This commit is contained in:
commit
e066846456
10 changed files with 83 additions and 77 deletions
|
|
@ -53,8 +53,23 @@ local function DisplayValue(props)
|
|||
elseif next(props.value) == nil then
|
||||
-- If it's empty, show empty braces
|
||||
textRepresentation = "{}"
|
||||
elseif next(props.value) == 1 then
|
||||
-- We don't need to support mixed tables, so checking the first key is enough
|
||||
-- to determine if it's a simple array
|
||||
local out, i = table.create(#props.value), 0
|
||||
for k, v in props.value do
|
||||
i += 1
|
||||
|
||||
-- Wrap strings in quotes
|
||||
if type(v) == "string" then
|
||||
v = '"' .. v .. '"'
|
||||
end
|
||||
|
||||
out[i] = tostring(v)
|
||||
end
|
||||
textRepresentation = "{ " .. table.concat(out, ", ") .. " }"
|
||||
else
|
||||
-- If it has children, list them out
|
||||
-- Otherwise, show the table contents as a dictionary
|
||||
local out, i = {}, 0
|
||||
for k, v in pairs(props.value) do
|
||||
i += 1
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ function gatherAssetUrlsRecursive(currentTable, currentUrls)
|
|||
if typeof(value) == "string" then
|
||||
table.insert(currentUrls, value)
|
||||
elseif typeof(value) == "table" then
|
||||
gatherAssetUrlsRecursive(value)
|
||||
gatherAssetUrlsRecursive(value, currentUrls)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue