API Reference

@sapphire/shapeshift

Type-safe validation library with a fluent builder API, supporting schemas, unions, records, and custom validators.

Official Documentation ↗
CompatibilityThis documentation covers version v3.11. Check the official docs for the latest API surface.

Installation

npmnpm install @sapphire/shapeshift

Methods

@sapphire/shapeshift is type-safe validation library with a fluent builder api, supporting schemas, unions, records, and custom validators. This page documents the core methods, installation, and common usage patterns for the current stable release.

Installation

Install @sapphire/shapeshift with your preferred package manager using the command shown in the frontmatter. The package is published to the npm registry and ships with TypeScript types where applicable.

Core methods

The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v3.11 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.

Frequently asked questions

The faq section in the frontmatter answers the most common questions about @sapphire/shapeshift, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.

FAQ

Is it related to Sapphire bots?
Yes. It is part of the Sapphire utilities suite used by Sapphire Discord bots.
Does it support async validation?
Yes. Use validator.runAsync for async rules and predicates.
Can I export JSON Schema?
It focuses on runtime validation; for JSON Schema use TypeBox or zod-to-json-schema.