> For the complete documentation index, see [llms.txt](https://schema.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://schema.js.org/documents/any/validate.md).

# Validate

Validate any value by using this method which exists on all Schema types

```typescript
import Schema, { SchemaError } from "@rapidom/schema";

Schema.number().validate(1); // returns 1

try {
  Schema.number().validate("not number"); // fails
} catch (error) {
  if (error instanceof SchemaError) {
    // validation error
  }
  
  // not validation error
}
```
