Hi there fellow developers!
A very basic data validation system for FiveM ( Not really FiveM, it’s environment agnostic, meaning it can be used anywhere where Lua runs with minor tweaks ). During my time creating custom resources to sharpen my general programming skills, I came across an issue where sometimes it would be awesome to surely know that the data being passed around the resource would be pure and the type I expect it to be since it can only be detected during runtime. And lua-vBuilder-fivem
was born.
This resource allows you to safely validate your data by creating custom schemas, here’s a very short and quick example.
local playerNameValidation <const> = vBuilder:string().min(1).max(10)
local result, error = playerNameValidation.parse("John Doe")
print(json.encode(result)) -- "John Doe"
It supports these data types: arrays, objects, strings, numbers, booleans
and even custom enums
and unions
.
A more detailed README
is published in the GitHub repository of this resource.
aquapha/lua-vBuilder-fivem: Data validation builder for FiveM Lua (github.com)
A | B |
---|---|
Code is accessible | Yes |
Subscription-based | No |
Lines (approximately) | 421 |
Requirements | None |
Support | Yes/OSS |