mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
- Simplified structure validation by re-exporting functions from structure_config and validate_structure modules for better maintainability. - Consolidated validation logic in validate.lua, delegating to validate_package module for clearer orchestration. - Introduced new quick guide functionalities including step management (add, remove, update, reset ordering) and media handling (thumbnail and video URL validation). - Added utility functions for URL validation and step creation, enhancing the quick guide's usability. - Established type definitions for steps and media states to improve code clarity and type safety. - Enhanced schema editor with new field and relation definitions, providing a more robust structure for database schema management.
26 lines
619 B
Lua
26 lines
619 B
Lua
--- Update a step in the list
|
|
---@param steps Step[] Array of steps
|
|
---@param stepId string ID of step to update
|
|
---@param updates table Partial step updates
|
|
---@return Step[] Updated steps array
|
|
local function update_step(steps, stepId, updates)
|
|
local result = {}
|
|
for i, step in ipairs(steps) do
|
|
if step.id == stepId then
|
|
local updatedStep = {}
|
|
for k, v in pairs(step) do
|
|
updatedStep[k] = v
|
|
end
|
|
for k, v in pairs(updates) do
|
|
updatedStep[k] = v
|
|
end
|
|
result[i] = updatedStep
|
|
else
|
|
result[i] = step
|
|
end
|
|
end
|
|
return result
|
|
end
|
|
|
|
return update_step
|