📦
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

Was this helpful?

  1. Documents
  2. Object

Keys

Checks if all keys of the given object match the given object schema

import Schema from "@rapidom/schema";

const Validator = Schema.object().keys({
  foo: Schema.number().min(56).integer().required(),
  bar: Schema.boolean().default(false),
});

If this method is used, then there can not be any unknown keys in the given object in the validate method

PreviousMinNextString

Last updated 3 years ago

Was this helpful?