Key of

ReferenceSchema API

s.keyOf()

A reference to an entry in a record: an author, a category, a product.

Use it for

  • Pointing at shared content instead of copying it
  • A dropdown of authors, tags or categories

KeyOf Schema

s.keyOf(schema)

schema

Key reference to another Val module

In Val Studio

Methods

.validate

Custom validation function

Example

Example

TypeScript
import keysVal from "./keys.val"; // this must be a record
s.keyOf(keysVal)