@jakguru/vueprint / @jakguru/vueprint/utilities/validation
Module: @jakguru/vueprint/utilities/validation
Classes
Functions
getDeserializedSchema
▸ getDeserializedSchema(serialized): any
Create a Joi schema from a serialized Joi schema
Parameters
| Name | Type | Description |
|---|---|---|
serialized | string | The serialized Joi schema |
Returns
any
A Joi schema
Defined in
src/utilities/validation.ts:49
getJoiValidationErrorI18n
▸ getJoiValidationErrorI18n(error, t, label?): string
Get the translated error message for a Joi validation error
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
error | undefined | Error | undefined | The error to translate |
t | any | undefined | The translation function |
label | string | 'the Field' | The label of the field being validated |
Returns
string
The translated error message
Defined in
src/utilities/validation.ts:61
isGoodString
▸ isGoodString(string): boolean
Check if a variable is a string which is not empty
Parameters
| Name | Type | Description |
|---|---|---|
string | unknown | The variable which should be tested |
Returns
boolean
Whether the string is a good string
Defined in
src/utilities/validation.ts:82
isValidLuhn
▸ isValidLuhn(input): boolean
Check if a string is a valid Luhn number
Parameters
| Name | Type | Description |
|---|---|---|
input | unknown | The input to check |
Returns
boolean
A boolean indicating whether the input is a valid Luhn number