{"id":20460976,"url":"https://github.com/ericgj/elm-validation","last_synced_at":"2025-04-13T06:15:32.382Z","repository":{"id":57675073,"uuid":"81166533","full_name":"ericgj/elm-validation","owner":"ericgj","description":"Tools for managing validity and error state of data, e.g. from user input.","archived":false,"fork":false,"pushed_at":"2018-12-03T00:38:15.000Z","size":90,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T06:15:30.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericgj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-07T04:32:58.000Z","updated_at":"2024-02-25T15:32:32.000Z","dependencies_parsed_at":"2022-09-02T14:25:50.607Z","dependency_job_id":null,"html_url":"https://github.com/ericgj/elm-validation","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Felm-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Felm-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Felm-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Felm-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericgj","download_url":"https://codeload.github.com/ericgj/elm-validation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670434,"owners_count":21142904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T12:22:42.593Z","updated_at":"2025-04-13T06:15:32.362Z","avatar_url":"https://github.com/ericgj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elm-validation\n\nTools for managing validity and error state of data, e.g. from user input.\n\n## To install\n\n```\n$ elm install ericgj/elm-validation\n```\n\n## Example\n\nBasic usage for validation in an HTML form.\n\n    view : Form -\u003e Html Msg\n    view form =\n        div []\n            [ input\n                [ type_ \"text\"\n                , value\n                    (form.input\n                        |\u003e Validation.toString identity\n                    )\n                , onInput\n                    (Validation.validate isRequired\n                        \u003e\u003e SetInput\n                    )\n                ]\n                []\n            , div \n                [ class \"error\" ]\n                [ text\n                    (Validation.message form.input\n                        |\u003e Maybe.withDefault \"\"\n                    )\n                ]\n            ]\n\n\nCombining validation of form fields to determine overall validity of a model.\n(For example, this could be used to determine if the submit button should be\nenabled on the form.)\n\n    validateForm : Form -\u003e ValidationResult Model\n    validateForm form =\n        Validation.valid Model\n            |\u003e Validation.andMap form.field1\n            |\u003e Validation.andMap form.field2\n\n\n\n[See the Elm package for full usage docs][pkg].\n\n\n\n[pkg]: http://package.elm-lang.org/packages/ericgj/elm-validation/latest\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Felm-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericgj%2Felm-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Felm-validation/lists"}