mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-05 19:19:35 +00:00
15 lines
440 B
Lua
15 lines
440 B
Lua
--- Validate post content
|
|
---@param content? string Post content to validate
|
|
---@return ValidationResult Validation result
|
|
local function validate_content(content)
|
|
if not content or content == "" then
|
|
return { valid = false, error = "Post cannot be empty" }
|
|
end
|
|
if #content > 500 then
|
|
return { valid = false, error = "Post too long (max 500 chars)" }
|
|
end
|
|
return { valid = true }
|
|
end
|
|
|
|
return validate_content
|