@@ -32,11 +32,11 @@ print(utils.quote('hello "world"')) --> 'hello "world"'
3232
3333** Validation** :
3434
35- | Function | Description |
36- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
37- | [ ` assert_arg(argn, v, validator?, optional?, lv?) ` ] ( #fn-assert-arg ) | Assert argument value using [ ` mods.validate ` ] ( /modules/validate ) and raise a Lua error on failure. |
38- | [ ` validate(name, v, validator?, optional?, msg?) ` ] ( #fn-validate ) | Validate a value using [ ` mods.validate ` ] ( /modules/validate ) and raise a Lua error on failure. |
39- | [ ` validate(path, v, validator?, optional?, msg?) ` ] ( #fn-validate ) | Validate a value using [ ` mods.validate ` ] ( /modules/validate ) and raise a Lua error on failure. |
35+ | Function | Description |
36+ | ------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
37+ | [ ` assert_arg(argn, v, validator?, optional?, lv?) ` ] ( #fn-assert-arg ) | Assert argument value using ` mods.validate ` and raise a Lua error on failure. |
38+ | [ ` validate(name, v, validator?, optional?, msg?) ` ] ( #fn-validate ) | Validate a value using ` mods.validate ` and raise a Lua error on failure. |
39+ | [ ` validate(path, v, validator?, optional?, msg?) ` ] ( #fn-validate ) | Validate a value using ` mods.validate ` and raise a Lua error on failure. |
4040
4141### Formatting
4242
@@ -148,8 +148,7 @@ print(stringify({ a = 1 }))
148148
149149#### ` assert_arg(argn, v, validator?, optional?, lv?) `
150150
151- Assert argument value using [ ` mods.validate ` ] ( /modules/validate ) and raise a Lua
152- error on failure.
151+ Assert argument value using ` mods.validate ` and raise a Lua error on failure.
153152
154153** Parameters** :
155154
@@ -183,17 +182,15 @@ utils.assert_arg(3, "x", "number", false, "need {{expected}}, got {{got}}")
183182
184183#### ` validate(name, v, validator?, optional?, msg?) `
185184
186- Validate a value using [ ` mods.validate ` ] ( /modules/validate ) and raise a Lua
187- error on failure.
185+ Validate a value using ` mods.validate ` and raise a Lua error on failure.
188186
189187** Parameters** :
190188
191189- ` name ` (` string ` ): Name for the error prefix.
192190- ` v ` (` any ` ): Value to validate.
193191- ` validator? ` (` modsValidatorName ` ): Validator name (defaults to ` "truthy" ` ).
194192- ` optional? ` (` boolean ` ): Skip errors when ` v ` is ` nil ` (defaults to ` false ` ).
195- - ` msg? ` (` string ` ): Optional override template passed to
196- [ ` mods.validate ` ] ( /modules/validate ) .
193+ - ` msg? ` (` string ` ): Optional override template passed to ` mods.validate ` .
197194
198195** Return** :
199196
@@ -212,17 +209,15 @@ utils.validate("count", "x", "number")
212209
213210#### ` validate(path, v, validator?, optional?, msg?) `
214211
215- Validate a value using [ ` mods.validate ` ] ( /modules/validate ) and raise a Lua
216- error on failure.
212+ Validate a value using ` mods.validate ` and raise a Lua error on failure.
217213
218214** Parameters** :
219215
220216- ` path ` (` table ` ): Path parts for the error name.
221217- ` v ` (` any ` ): Value to validate.
222218- ` validator? ` (` modsValidatorName ` ): Validator name (defaults to ` "truthy" ` ).
223219- ` optional? ` (` boolean ` ): Skip errors when ` v ` is ` nil ` (defaults to ` false ` ).
224- - ` msg? ` (` string ` ): Optional override template passed to
225- [ ` mods.validate ` ] ( /modules/validate ) .
220+ - ` msg? ` (` string ` ): Optional override template passed to ` mods.validate ` .
226221
227222** Return** :
228223
@@ -238,5 +233,4 @@ utils.validate({ "ctx", "users", 1, "name" }, 123, "string")
238233
239234> [ !NOTE]
240235>
241- > On failure, ` path ` is rendered with
242- > [ ` mods.utils.keypath ` ] ( /modules/utils#fn-keypath ) .
236+ > On failure, ` path ` is rendered with ` mods.utils.keypath ` .
0 commit comments