@mikrav/reval

0.0.2 • Public • Published

Reval

Simple validation schema for Rescript.

Install

npm install @mikrav/reval

Usage

open Reval

let schema = Schema.Dict(
  [RequiredKeys(["name", "age"])],
  [
    //
    ("name", String([MinLength(2)])),
    ("age", Int([GTE(0)])),
    ("description", String([NotEmpty])),
  ],
)

let input = Input.Dict([
  //
  ("name", String("Moona"))
  ("age", Int(3)),
  ("description", String("Hello"))
])

validate(schema, input)

// output:
// result<Input.t, Error.t>

Readme

Keywords

Package Sidebar

Install

npm i @mikrav/reval

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

33 kB

Total Files

22

Last publish

Collaborators

  • damaera