Модуль:GetField: различия между версиями

Нет описания правки
Нет описания правки
 
Строка 1121: Строка 1121:
end
end


local valueIsPrimitiveArray = is_array_of_primitives(value)
if options.skipPrimitiveRoot and is_array_of_primitives(value) then
if options.skipPrimitiveRoot and is_array_of_primitives(value) then
return
return
Строка 1138: Строка 1139:
local v = value[k]
local v = value[k]
local key
local key
if prefix and options.nestedKeyMode == "prefixed" then
if prefix then
key = prefix .. "." .. tostring(k)
key = prefix .. "." .. tostring(k)
else
else
Строка 1157: Строка 1158:
end
end


if next(v) ~= nil then
if next(v) ~= nil and not is_array_of_primitives(v) then
local childPrefix = (options.nestedKeyMode == "prefixed") and key or nil
local childPrefix = (type(k) == "string") and key or nil
append_table_fields(parts, v, options, childPrefix)
append_table_fields(parts, v, options, childPrefix)
end
end