Skip to content

@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

NameTypeDescription
serializedstringThe 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

NameTypeDefault valueDescription
errorundefined | ErrorundefinedThe error to translate
tanyundefinedThe translation function
labelstring'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

NameTypeDescription
stringunknownThe 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

NameTypeDescription
inputunknownThe input to check

Returns

boolean

A boolean indicating whether the input is a valid Luhn number

Defined in

src/utilities/validation.ts:19

Vueprint is a commercial work product released under the MIT License and is provided as-is with no warranty or guarantee of support.