PhantomCaleb (talk | contribs) m (Protected "Module:UtilsArg": Critical wiki page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
PhantomCaleb (talk | contribs) m (Changed protection level for "Module:UtilsArg" ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))) |
Revision as of 17:55, 3 May 2020
This module takes care of parsing and validating template input, allowing module developers to focus on core logic. It aims to achieve the same goal as Wikipedia's Module:Arguments but with a different approach:
- Validation is based on a schema that is also used to auto-generate documentation. This guarantees that the documentation is up to date with the validation code.
- No implicit behaviour. If you want to trim a parameter, you specify
trim = true
. If you want to treat empty strings as nil, you specifynilIfEmpty = true
. Module:Arguments does several things "automagically" by default and lacks clarity as a result. - No frame handling. It's up to the caller to consolidate
frame.args
andframe:getParent().args
if needed. This can be done with utilsTable.merge. Most modules typically need only one frame anyway.
Lua error in package.lua at line 80: module 'Module:UtilsArg/Validate' not found.