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

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


     return tostring(v) == target
     return tostring(v) == target
end
local function is_nonempty_value(v)
    if v == nil then return false end
    if type(v) == "table" then
        return next(v) ~= nil
    end
    return true
end
end


Строка 481: Строка 489:
             if type(entry) == "table" then
             if type(entry) == "table" then
                 local v = get_by_path(entry, keyPath)
                 local v = get_by_path(entry, keyPath)
                 if v ~= nil then
                 if is_nonempty_value(v) then
                     matches[#matches + 1] = idKey
                     matches[#matches + 1] = idKey
                 end
                 end