bkuhlmann/form-validator/1.2.2

Rerouted (archive, verified). The original repository is gone. This copy comes from an archive (Software Heritage). The Lamdera package server serves a copy recovered from swh:1:rev:6a2c83b4256c217a8ca6ed53c26ee776f9cbb0f6 (Software Heritage, origin https://github.com/bkuhlmann/form-validator).

What we checked: Software Heritage archived tag 1.2.2 of github.com/bkuhlmann/form-validator at commit 6a2c83b4256c; its commit 6a2c83b4256c is from 2022-10-22 22:50 UTC, before the version was published (2022-10-22 22:51 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip is our own, made from Software Heritage's copy of the files Elm uses, so its SHA-1 is not the published one.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/bkuhlmann/form-validator/zipball/1.2.2/

FormValidator.Models

The Form Validator component models.

type alias Form key =
List (Field key)

The form model which stores a list of fields for input and validation.

type alias Field key =
{ key : key
, value : String
, validators : Validators
, errors : Errors
}

The form field, identified by unique key, which stores a value, validators of that value, and validation errors (if any).

type alias Validators =
List Validator

A list of validators for a field.

type alias Validator =
String -> Maybe String

A field validator which evaluates to an error string (invalid) or nothing at all (valid).

type alias Values =
List Value

A list of field values to be validated.

type alias Value =
String

A field value to be validated.

type alias Errors =
List Error

The corresponding error messages of an invalid field value(s).

type alias Error =
Maybe String

The corresponding error message of an invalid field value.