@traveloka/validation
TypeScript icon, indicating that this package has built-in type declarations

3.6.0 • Public • Published

React Schema

Installation

yarn

yarn add @traveloka/validation

npm

npm i @traveloka/validation --save

Rules

  • required
  • maxLength(length: number)
  • or(rules: Rule | Rule[])

Example study case

  • Password length minimal 5 character
  • Password must contain at least one symbol or number
<Field
  component={TextInput}
  rules={[
    minLength(5),
    or([
      containSymbol,
      containNumber
    ])
  ]} />

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i @traveloka/validation

    Weekly Downloads

    280

    Version

    3.6.0

    License

    MIT

    Unpacked Size

    23.3 kB

    Total Files

    45

    Last publish

    Collaborators

    • traveloka-engineering
    • district-engineering
    • angga