VE Lua Documentation

Press F to search!

tableIsDict

Definition


-- @/lua/common/utils.lua:576

-- checks if the table is a dictionary by checking if key 1 exists
function tableIsDict(tbl)
  if type(tbl) ~= "table" then
    return false
  end
  return next(tbl) ~= 1
end

Callers

@/lua/common/jbeam/optimization.lua
  for keyEntry, entry in pairs(vehicle) do
    if type(entry) == "table" and tableIsDict(entry) and jbeamUtils.ignoreSections[keyEntry] == nil and tableIsDict(entry[0]) and entry[0]['disableSection'] ~= nil then
      --log('D', "jbeam.postProcess"," - removing disabled section '"..keyEntry.."'")
  for keyEntry, entry in pairs(vehicle) do
    if type(entry) == "table" and tableIsDict(entry) and jbeamUtils.ignoreSections[keyEntry] == nil and tableIsDict(entry[0]) and entry[0]['disableSection'] ~= nil then
      --log('D', "jbeam.postProcess"," - removing disabled section '"..keyEntry.."'")
@/lua/common/jbeam/tableSchema.lua
  end
  if tableIsDict(rowValue) then
    if rowValue.include and csvlib then
      local rv = rowValue[rk]
      if tableIsDict(rv) then
        tableMerge(newRow, replaceSpecialValues(rv))
  end
  if tableIsDict(header) then
    if not omitWarnings then
    --[[
    if type(entry) == "table" and tableIsDict(entry) then
      log('D', ""," ** "..tostring(keyEntry).." = [DICT] #" ..tableSize(entry))
      log('D', ""," ** "..tostring(keyEntry).." = [DICT] #" ..tableSize(entry))
    elseif type(entry) == "table" and not tableIsDict(entry) then
      log('D', ""," ** "..tostring(keyEntry).." = [LIST] #"..tableSize(entry))
    -- then walk the tables
    if type(entry) == "table" and not tableIsDict(entry) and jbeamUtils.ignoreSections[keyEntry] == nil and not tableIsEmpty(entry) then
      if tableIsDict(entry) then
    if type(entry) == "table" and not tableIsDict(entry) and jbeamUtils.ignoreSections[keyEntry] == nil and not tableIsEmpty(entry) then
      if tableIsDict(entry) then
        -- ENTRY DICTS TO BE WRITTEN
@/lua/common/jbeam/slotSystem.lua
      -- care about the slotoptions if we are first
      if type(section) == "table" and not tableIsDict(section) then
        local localSlotOptions = deepcopy(slotOptions) or {}
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua
        for lineNum, lineData in ipairs(section) do
          if lineNum > 1 and tableIsDict(lineData) then
            -- Line is dictionary, so it declares modifier(s)
            getLineASTNodes(astHierarchy, lineData.__astNodeIdx, astNodeIdxs)
            if tableIsDict(lineData) then
              -- Line is dictionary, so it declares modifier(s)
                local colData = lineData[lineCol]
                if type(colData) == 'table' and tableIsDict(colData) and #lineData > headerSize then
                  for mod, modVal in pairs(colData) do

  if tableIsDict(tbl) then
    local i = 1
@/lua/vehicle/ve_utils.lua
    end
    if tableIsDict(rowValue) then
      -- case where options is a dict on its own, filling a whole line
        -- check if inline options are provided, merge them then
        if rvcc >= headerSize and type(rv) == "table" and tableIsDict(rv) and #rowValue > headerSize then
          tableMerge(newRow, rv)
  if type(data) == "table" then
    if tableIsDict(data) then
      f:write("{")
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamSpellchecker.lua
        end
        if tableIsDict(header) then
          log('W', "", filePath .. " *** Invalid table header, must be a list, not a dict: "..dumps(header))
          end
          if tableIsDict(rowValue) then
            -- case where options is a dict on its own, filling a whole line
              local rv = rowValue[rk]
              if type(rv) == 'table' and tableIsDict(rv) and #rowValue > headerSize then
                mods = rv

          if tableIsDict(row) then
            mods = row
@/lua/common/jbeam/scaling.lua
  for keyEntry, entry in pairs(vehicle) do
    if type(entry) == "table" and tableIsDict(entry) and not jbeamUtils.ignoreSections[keyEntry] then
      stack[1] = entry