📦
Schema
  • Getting Started
  • Documents
    • Basics
      • Extend
    • Any
      • Label
      • Default
      • Required
      • Pipe
      • Validate
    • Array
      • Length
      • Max
      • Min
      • Items
    • Boolean
    • Date
      • Max
      • Min
    • Number
      • Max
      • Min
      • Multiple
      • Integer
      • Port
      • Positive
      • Precision
    • Object
      • Length
      • Max
      • Min
      • Keys
    • String
      • Alphanum
      • Credit Card
      • Email
      • Enum
      • IP Address
      • Length
      • Max
      • Min
      • Numeral
      • Regex
      • Token
  • Source Code
Powered by GitBook
On this page
  • Positive
  • Negative

Was this helpful?

  1. Documents
  2. Number

Positive

Check if the value is positive or negative

Positive

Checks if the given number is a valid port number

import Schema from "@rapidom/schema";

const Validator = Schema.number().positive();
const Validator = Schema.number().positive(true); // same result

Negative

Checks if the given number is a valid port number

import Schema from "@rapidom/schema";

const Validator = Schema.number().positive(false);
PreviousPortNextPrecision

Last updated 3 years ago

Was this helpful?