4 Forms

4 Forms

  • Getting Started
  • API
  • Github
  • Help

›API Reference

Introduction

  • Getting Started
  • Installation
  • Motivation
  • Examples

Guides

  • Intro
  • Field
  • Schema
  • Nested schema
  • Related Field

API Reference

  • API Reference
  • Field
  • Schema
  • When
  • Rules

    • Generic
    • String
    • Number
    • Boolean
    • Array
    • Object
    • Iterator

Field()

Creates a field to chain with your rules to build complex validation for your data.

Example

import { Field } from "v4f";

const username = Field()
    .string()
    .min(6) // min length 6
    .max(10) // max length is 10
    .last("z") // last char must be "z"
    .required(); // must be no empty and no null or undefined

username.validate("nassihfz"); // true

username.validate(""); // false

username.validate("abc1z"); // false
← API ReferenceSchema →
  • Example
4 Forms
Docs
Getting StartedGuidesAPI Reference
Community
Stack OverflowProject ChatTwitter
More
GitHub
Copyright © 2019 Soufiane Nassih